diff --git a/doh-client/client.go b/doh-client/client.go index 1624247..dc4fb42 100644 --- a/doh-client/client.go +++ b/doh-client/client.go @@ -178,6 +178,10 @@ func (c *Client) handlerFunc(w dns.ResponseWriter, r *dns.Msg, isTCP bool) { panic("Unknown request Content-Type") } + if req.err != nil { + return + } + contentType := "" candidateType := strings.SplitN(req.response.Header.Get("Content-Type"), ";", 2)[0] if candidateType == "application/json" {