Skip to content

Commit

Permalink
Narrowly detect only Unauthorized status codes.
Browse files Browse the repository at this point in the history
Signed-off-by: Corey Larson <corey@earthly.dev>
  • Loading branch information
dchw committed Apr 12, 2021
1 parent 077b156 commit b8fcd1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/resolver/authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func (ah *authHandler) fetchToken(ctx context.Context, sm *session.Manager, g se

func invalidAuthorization(c auth.Challenge, responses []*http.Response) error {
lastResponse := responses[len(responses)-1]
if lastResponse.StatusCode >= http.StatusBadRequest {
if lastResponse.StatusCode == http.StatusUnauthorized {
return errors.Wrapf(docker.ErrInvalidAuthorization, "authorization status: %v", lastResponse.StatusCode)
}

Expand Down

0 comments on commit b8fcd1e

Please sign in to comment.