Skip to content

Commit 66701b8

Browse files
bug symfony#31069 Make sure that logged URL is the same as the one which is requested. (drupol)
This PR was squashed before being merged into the 4.3-dev branch (closes symfony#31069). Discussion ---------- Make sure that logged URL is the same as the one which is requested. | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#31068 | License | MIT Commits ------- 526cad6 Make sure that logged URL is the same as the one which is requested.
2 parents 751baaf + 526cad6 commit 66701b8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Symfony/Component/HttpClient/NativeHttpClient.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ public function request(string $method, string $url, array $options = []): Respo
159159
$this->multi->dnsCache = $options['resolve'] + $this->multi->dnsCache;
160160
}
161161

162+
$this->logger && $this->logger->info(sprintf('Request: %s %s', $method, implode('', $url)));
163+
162164
[$host, $port, $url['authority']] = self::dnsResolve($url, $this->multi, $info, $onProgress);
163165

164166
if (!isset($options['headers']['host'])) {
@@ -208,10 +210,7 @@ public function request(string $method, string $url, array $options = []): Respo
208210
$context = stream_context_create($context, ['notification' => $notification]);
209211
self::configureHeadersAndProxy($context, $host, $options['request_headers'], $proxy, $noProxy);
210212

211-
$url = implode('', $url);
212-
$this->logger && $this->logger->info(sprintf('Request: %s %s', $method, $url));
213-
214-
return new NativeResponse($this->multi, $context, $url, $options, $gzipEnabled, $info, $resolveRedirect, $onProgress, $this->logger);
213+
return new NativeResponse($this->multi, $context, implode('', $url), $options, $gzipEnabled, $info, $resolveRedirect, $onProgress, $this->logger);
215214
}
216215

217216
/**

0 commit comments

Comments
 (0)