Skip to content

Commit

Permalink
Fix for bearertokenauth extension Always return 401 Unauthorized via …
Browse files Browse the repository at this point in the history
…HTTP
  • Loading branch information
nagashan committed Dec 17, 2023
1 parent d24f4ea commit 2a0defd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extension/bearertokenauthextension/bearertokenauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func (b *BearerTokenAuth) RoundTripper(base http.RoundTripper) (http.RoundTrippe
// Authenticate checks whether the given context contains valid auth data.
func (b *BearerTokenAuth) Authenticate(ctx context.Context, headers map[string][]string) (context.Context, error) {
auth, ok := headers["authorization"]
if !ok {
auth, ok = headers["Authorization"]
}
if !ok || len(auth) == 0 {
return ctx, errors.New("authentication didn't succeed")
}
Expand Down

0 comments on commit 2a0defd

Please sign in to comment.