Skip to content

Commit

Permalink
security: avoid logging authorization header even when invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Van Bouwel committed Nov 20, 2024
1 parent c24c4ad commit 35b33ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requestutils/amz-credential-value.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func getSignatureCredentialStringFromRequestAuthHeader(authorizationHeader strin
return "", fmt.Errorf("programming error should use empty authHeader to get credential part")
}
if !strings.HasPrefix(authorizationHeader, expectedAuthorizationStartWithCredential) {
return "", fmt.Errorf("invalid authorization header: %s", authorizationHeader)
return "", errors.New("invalid authorization header")
}
authorizationHeaderTrimmed := authorizationHeader[len(expectedAuthorizationStartWithCredential):]
return strings.Split(authorizationHeaderTrimmed, ", ")[0], nil
Expand Down

0 comments on commit 35b33ad

Please sign in to comment.