Skip to content

Commit 34a170c

Browse files
authored
Simplifies Bearer regex
`(?:\s+)?` is just `\s*` but harder
1 parent 4058765 commit 34a170c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AuthorizationValidators/BearerTokenValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function validateAuthorization(ServerRequestInterface $request)
9494
}
9595

9696
$header = $request->getHeader('authorization');
97-
$jwt = \trim((string) \preg_replace('/^(?:\s+)?Bearer\s/', '', $header[0]));
97+
$jwt = \trim((string) \preg_replace('/^\s*Bearer\s/', '', $header[0]));
9898

9999
try {
100100
// Attempt to parse the JWT

0 commit comments

Comments
 (0)