Skip to content

Commit b82c060

Browse files
Merge branch '4.3' into 4.4
* 4.3: [HttpClient] expose only gzip when doing transparent compression add species to inflector and inflector tests
2 parents 7109135 + 5f0b62a commit b82c060

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CurlHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ public function request(string $method, string $url, array $options = []): Respo
232232
$curlopts[CURLOPT_NOSIGNAL] = true;
233233
}
234234

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

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

0 commit comments

Comments
 (0)