Skip to content

Commit

Permalink
fix: for repeated failure with authentication (#1749)
Browse files Browse the repository at this point in the history
We use errtrace to automatically add error tracing, but it seems like
the HTTP client expects a literal ErrUseLastResponse, so we need to
exclude it from wrapping.
  • Loading branch information
alecthomas authored Jun 12, 2024
1 parent ff66550 commit 6e49fd6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion authn/authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func checkAuth(ctx context.Context, logger *log.Logger, endpoint *url.URL, creds
client := &http.Client{
Timeout: time.Second * 5,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
return http.ErrUseLastResponse //errtrace:skip(the HTTP client doesn't handle wrapping errors)
},
}
req, err := http.NewRequestWithContext(ctx, http.MethodHead, endpoint.String(), nil)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/lefthook

0 comments on commit 6e49fd6

Please sign in to comment.