8000 [HttpClient] Allow bearer token with colon · symfony/symfony@82ed1ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 82ed1ec

Browse files
stephanvierkantnicolas-grekas
authored andcommitted
[HttpClient] Allow bearer token with colon
1 parent 50f37f0 commit 82ed1ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpClient/HttpClientTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDif 7B0B f line change
@@ -110,7 +110,7 @@ private static function prepareRequest(?string $method, ?string $url, array $opt
110110
throw new InvalidArgumentException(sprintf('Option "auth_basic" must be string or an array, "%s" given.', \gettype($options['auth_basic'])));
111111
}
112112

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

0 commit comments

Comments
 (0)
0