Skip to content

Commit a2baf9c

Browse files
Merge branch '4.4' into 5.2
* 4.4: [Inflector][String] wrong plural form of words ending by "pectus" [HttpClient] Don't prepare the request in ScopingHttpClient [Console] Fixes for PHP 8.1 deprecations Fix/Rewrite .gitignore regex builder
2 parents cdaf3df + 7bac9c0 commit a2baf9c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ScopingHttpClient.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static function forBaseUri(HttpClientInterface $client, string $baseUri,
5959
*/
6060
public function request(string $method, string $url, array $options = []): ResponseInterface
6161
{
62+
$e = null;
6263
$url = self::parseUrl($url, $options['query'] ?? []);
6364

6465
if (\is_string($options['base_uri'] ?? null)) {
@@ -72,13 +73,18 @@ public function request(string $method, string $url, array $options = []): Respo
7273
throw $e;
7374
}
7475

75-
[$url, $options] = self::prepareRequest($method, implode('', $url), $options, $this->defaultOptionsByRegexp[$this->defaultRegexp], true);
76-
$url = implode('', $url);
76+
$options = self::mergeDefaultOptions($options, $this->defaultOptionsByRegexp[$this->defaultRegexp], true);
77+
if (\is_string($options['base_uri'] ?? null)) {
78+
$options['base_uri'] = self::parseUrl($options['base_uri']);
79+
}
80+
$url = implode('', self::resolveUrl($url, $options['base_uri'] ?? null));
7781
}
7882

7983
foreach ($this->defaultOptionsByRegexp as $regexp => $defaultOptions) {
8084
if (preg_match("{{$regexp}}A", $url)) {
81-
$options = self::mergeDefaultOptions($options, $defaultOptions, true);
85+
if (null === $e || $regexp !== $this->defaultRegexp) {
86+
$options = self::mergeDefaultOptions($options, $defaultOptions, true);
87+
}
8288
break;
8389
}
8490
}

0 commit comments

Comments
 (0)