Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions extension/bearertokenauthextension/bearertokenauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,9 @@ func (b *bearerTokenAuth) RoundTripper(base http.RoundTripper) (http.RoundTrippe

// Authenticate checks whether the given context contains valid auth data. Validates tokens from clients trying to access the service (incoming requests)
func (b *bearerTokenAuth) Authenticate(ctx context.Context, headers map[string][]string) (context.Context, error) {
auth, ok := headers[strings.ToLower(b.header)]
if !ok {
auth, ok = headers[b.header]
}
// Use canonical header key to match how Go's HTTP server stores headers
auth, ok := headers[http.CanonicalHeaderKey(b.header)]

if !ok || len(auth) == 0 {
return ctx, fmt.Errorf("missing or empty authorization header: %s", b.header)
}
Expand Down
Loading