Skip to content

Commit

Permalink
WIP: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Sep 17, 2022
1 parent d69f143 commit f88f906
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion providers/dns/versio/versio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package versio

import (
"fmt"
"io"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -231,7 +232,10 @@ func muxSuccess() *http.ServeMux {
})

mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
log.Printf("Not Found for Request: (%+v)\n\n", r)
log.Printf("unexpected request: %+v\n\n", r)
data, _ := io.ReadAll(r.Body)
defer func() { _ = r.Body.Close() }()
log.Println(string(data))
http.NotFound(w, r)
})

Expand Down Expand Up @@ -267,6 +271,14 @@ func muxFailToCreateTXT() *http.ServeMux {
w.WriteHeader(http.StatusBadRequest)
})

mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
log.Printf("unexpected request: %+v\n\n", r)
data, _ := io.ReadAll(r.Body)
defer func() { _ = r.Body.Close() }()
log.Println(string(data))
http.NotFound(w, r)
})

return mux
}

Expand Down

0 comments on commit f88f906

Please sign in to comment.