mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-11-14 13:28:12 +00:00
Fix a problem when a single HTTP error crashes the program
This commit is contained in:
1 parent
ab2bf57995
commit
1be17bff4d
1 file changed
+4
@@ -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