Skip to content

Commit

Permalink
[HttpClient] expose only gzip when doing transparent compression
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 6, 2019
1 parent ddf9e0f commit 6571ddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpClient/CurlHttpClient.php
Expand Up @@ -210,8 +210,8 @@ public function request(string $method, string $url, array $options = []): Respo
$curlopts[CURLOPT_NOSIGNAL] = true;
}

if (!isset($options['normalized_headers']['accept-encoding'])) {
$curlopts[CURLOPT_ENCODING] = ''; // Enable HTTP compression
if (!isset($options['normalized_headers']['accept-encoding']) && CURL_VERSION_LIBZ & self::$curlVersion['features']) {
$curlopts[CURLOPT_ENCODING] = 'gzip'; // Expose only one encoding, some servers mess up when more are provided
}

foreach ($options['headers'] as $header) {
Expand Down

0 comments on commit 6571ddd

Please sign in to comment.