Skip to content

Commit cd0db78

Browse files
[HttpClient] Fix regex bearer
1 parent 46e8da3 commit cd0db78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpClient/HttpClientTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private static function prepareRequest(?string $method, ?string $url, array $opt
8686
throw new InvalidArgumentException(sprintf('Option "auth_basic" must be string or an array, %s given.', \gettype($options['auth_basic'])));
8787
}
8888

89-
if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._~+/0-9a-zA-Z]++=*+$}', $options['auth_bearer']))) {
89+
if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._=~+/0-9a-zA-Z]++$}', $options['auth_bearer']))) {
9090
throw new InvalidArgumentException(sprintf('Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, %s given.', \is_string($options['auth_bearer']) ? 'invalid string' : \gettype($options['auth_bearer'])));
9191
}
9292

0 commit comments

Comments
 (0)