Skip to content

Commit

Permalink
fix: include url on HTTP error
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 committed Jan 7, 2025
1 parent f2e2586 commit 9056444
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)

Check warning on line 45 in request.go

View check run for this annotation

Codecov / codecov/patch

request.go#L45

Added line #L45 was not covered by tests
}

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

0 comments on commit 9056444

Please sign in to comment.