Skip to content

Commit

Permalink
fix: include url on HTTP error (#29)
Browse files Browse the repository at this point in the history
we have per TLD resolvers and this helps end user
to self-service when one of DoH resolvers goes down
  • Loading branch information
lidel authored Jan 8, 2025
1 parent 68cc2ce commit 08689e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func doRequest(ctx context.Context, url string, m *dns.Msg) (*dns.Msg, error) {
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("HTTP error: %q [%d]", resp.Status, resp.StatusCode)
return nil, fmt.Errorf("HTTP error: %q [%d] from %q", resp.Status, resp.StatusCode, url)
}

if ct := resp.Header.Get("Content-Type"); ct != dohMimeType {
Expand Down

0 comments on commit 08689e9

Please sign in to comment.