Skip to content

Commit

Permalink
make word "bearer" in http auth header case insensitive (#1963)
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <[email protected]>
  • Loading branch information
krancour authored May 24, 2022
1 parent 8ca05f7 commit 6872ada
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion v2/apiserver/internal/api/rest/token_auth_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func (t *tokenAuthFilter) Decorate(handle http.HandlerFunc) http.HandlerFunc {
" ",
2,
)
if len(headerValueParts) != 2 || headerValueParts[0] != "Bearer" {
if len(headerValueParts) != 2 ||
strings.ToLower(headerValueParts[0]) != "bearer" {
t.writeResponse(
w,
http.StatusUnauthorized,
Expand Down

0 comments on commit 6872ada

Please sign in to comment.