Skip to content

Commit e39d66e

Browse files
bug symfony#35530 [HttpClient] Fix regex bearer (noniagriconomie)
This PR was merged into the 4.3 branch. Discussion ---------- [HttpClient] Fix regex bearer | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#34919 | License | MIT | Doc PR | none Small fix related to symfony#34919 (comment) Commits ------- cd0db78 [HttpClient] Fix regex bearer
2 parents 46e8da3 + cd0db78 commit e39d66e

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)