mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-30 16:25:39 +00:00
Fix a problem when a single HTTP error crashes the program
This commit is contained in:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user