From 526cad6909ceb06d6c1543129068445fd7d7d027 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 10 Apr 2019 22:08:15 +0200 Subject: [PATCH] Make sure that logged URL is the same as the one which is requested. --- src/Symfony/Component/HttpClient/NativeHttpClient.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpClient/NativeHttpClient.php b/src/Symfony/Component/HttpClient/NativeHttpClient.php index 18afa2d13e..6ca9f6cce1 100644 --- a/src/Symfony/Component/HttpClient/NativeHttpClient.php +++ b/src/Symfony/Component/HttpClient/NativeHttpClient.php @@ -159,6 +159,8 @@ final class NativeHttpClient implements HttpClientInterface, LoggerAwareInterfac $this->multi->dnsCache = $options['resolve'] + $this->multi->dnsCache; } + $this->logger && $this->logger->info(sprintf('Request: %s %s', $method, implode('', $url))); + [$host, $port, $url['authority']] = self::dnsResolve($url, $this->multi, $info, $onProgress); if (!isset($options['headers']['host'])) { @@ -208,10 +210,7 @@ final class NativeHttpClient implements HttpClientInterface, LoggerAwareInterfac $context = stream_context_create($context, ['notification' => $notification]); self::configureHeadersAndProxy($context, $host, $options['request_headers'], $proxy, $noProxy); - $url = implode('', $url); - $this->logger && $this->logger->info(sprintf('Request: %s %s', $method, $url)); - - return new NativeResponse($this->multi, $context, $url, $options, $gzipEnabled, $info, $resolveRedirect, $onProgress, $this->logger); + return new NativeResponse($this->multi, $context, implode('', $url), $options, $gzipEnabled, $info, $resolveRedirect, $onProgress, $this->logger); } /**