Skip to content

Commit 3d77e7d

Browse files
committed
Merge pull request #46 from php-http/identity-encoding-if-no-gzip
ask for identity encoding if gzip not available.
2 parents baefb00 + 551608d commit 3d77e7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DecoderPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public function __construct(array $config = [])
5252
*/
5353
public function handleRequest(RequestInterface $request, callable $next, callable $first)
5454
{
55-
$encodings = extension_loaded('zlib') ? ['gzip', 'deflate', 'compress'] : [];
55+
$encodings = extension_loaded('zlib') ? ['gzip', 'deflate', 'compress'] : ['identity'];
5656

57-
if ($this->useContentEncoding && count($encodings)) {
57+
if ($this->useContentEncoding) {
5858
$request = $request->withHeader('Accept-Encoding', $encodings);
5959
}
6060
$encodings[] = 'chunked';

0 commit comments

Comments
 (0)