Skip to content

Commit 00a6122

Browse files
stephanvierkantnicolas-grekas
authored andcommitted
[HttpClient] Allow bearer token with colon
1 parent 505e0f6 commit 00a6122

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

HttpClientTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)