diff --git a/network/resolver/http/http.go b/network/resolver/http/http.go index a407c693..889ad687 100644 --- a/network/resolver/http/http.go +++ b/network/resolver/http/http.go @@ -3,6 +3,7 @@ package http import ( "encoding/json" + "errors" "io/ioutil" "net/http" "net/url" @@ -58,7 +59,9 @@ func (r *Resolver) Resolve(name string) ([]*resolver.Record, error) { return nil, err } defer rsp.Body.Close() - + if rsp.StatusCode != 200 { + return nil, errors.New("non 200 response") + } b, err := ioutil.ReadAll(rsp.Body) if err != nil { return nil, err