Skip to content

Commit 39fbe66

Browse files
improve bearer validation
1 parent f460371 commit 39fbe66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/handlers/authenticate-handler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ AuthenticateHandler.prototype.getTokenFromRequest = function(request) {
138138

139139
AuthenticateHandler.prototype.getTokenFromRequestHeader = function(request) {
140140
const token = request.get('Authorization');
141-
const matches = token.match(/^Bearer\s(\S+)/);
141+
const matches = token.match(/^Bearer\s([0-9a-zA-Z-._~+/]+=*)$/);
142142

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

0 commit comments

Comments
 (0)