Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit be1602f

Browse files
authoredSep 28, 2023
fix: use improved bearer token vlaidation regex
Merge pull request #234 from jorenvandeweyer/bugfix/bearer-validation
2 parents b9d4093 + 4962cd9 commit be1602f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/handlers/authenticate-handler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class AuthenticateHandler {
139139

140140
getTokenFromRequestHeader (request) {
141141
const token = request.get('Authorization');
142-
const matches = token.match(/^Bearer\s(\S+)/);
142+
const matches = token.match(/^Bearer ([0-9a-zA-Z-._~+/]+=*)$/);
143143

144144
if (!matches) {
145145
throw new InvalidRequestError('Invalid request: malformed authorization header');

0 commit comments

Comments
 (0)
Please sign in to comment.