From 6571dddc4c093335185dbf6dc67f3b41d3a16b8b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 6 Nov 2019 11:21:02 +0100 Subject: [PATCH] [HttpClient] expose only gzip when doing transparent compression --- src/Symfony/Component/HttpClient/CurlHttpClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpClient/CurlHttpClient.php b/src/Symfony/Component/HttpClient/CurlHttpClient.php index 6c86a522c8142..e52a2cd0a5370 100644 --- a/src/Symfony/Component/HttpClient/CurlHttpClient.php +++ b/src/Symfony/Component/HttpClient/CurlHttpClient.php @@ -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) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy