Skip to content

Commit ba5a7fc

Browse files
author
Kyra Farrow
committed
Make sure that logged URL is the same as the one which is requested.
1 parent 6b0d38f commit ba5a7fc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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)