Skip to content

Commit 5991cc9

Browse files
dievskyjonnyzzz
authored andcommitted
Token type matching should be case-insensitive
See https://datatracker.ietf.org/doc/html/rfc2617#section-1.2
1 parent 8c56515 commit 5991cc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lambda/lambda.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ function parseToken(headers) {
5252
if (authorization.length > 0) {
5353
for (let i = 0; i < authorization.length; i++) {
5454
const token = authorization[i].value || ''
55-
const prefix = 'Bearer ';
56-
if (token.startsWith(prefix)) {
55+
const prefix = 'bearer ';
56+
if (token.toLowerCase().startsWith(prefix)) {
5757
return token.substring(prefix.length)
5858
}
5959
}

0 commit comments

Comments
 (0)