mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-11-23 11:09:04 +00:00
Check HTTP status code
This commit is contained in:
1 parent
1df71ac2b8
commit
d3f7665529
1 file changed
+6
@@ -183,6 +183,12 @@ func (c *Client) handlerFunc(w dns.ResponseWriter, r *dns.Msg, isTCP bool) {
|
||||
w.WriteMsg(reply)
|
||||
return
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
log.Printf("Server returned error: %s\n", resp.Status)
|
||||
reply.Rcode = dns.RcodeServerFailure
|
||||
w.WriteMsg(reply)
|
||||
return
|
||||
}
|
||||
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user