Skip to content

Fix deflate encoding handling and disable compress encoding #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 17, 2017

Conversation

ajgarlag
Copy link
Contributor

@ajgarlag ajgarlag commented Mar 14, 2017

Q A
Bug fix? yes
New feature? no
BC breaks? no/yes
Deprecations? no/yes
License MIT

What's in this PR?

This PR updates the DecoderPlugin to use the right decoder to manage deflate content-encoding and disable compress as there is no support in PHP and nobody uses it

This is the solution proposed by @joelwurtz in php-http/message#64 (comment) to the problem is described in php-http/message#64

Example Usage

<?php
require 'vendor/autoload.php';

$decoderPlugin = new Http\Client\Common\Plugin\DecoderPlugin();
$pluginClient = new Http\Client\Common\PluginClient(
    Http\Discovery\HttpClientDiscovery::find(),
    [$decoderPlugin]
);

$response = $pluginClient->sendRequest(
    new GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org/deflate')
);

var_dump($response->getBody()->getContents());

The result should be a JSON document like the one you can view at http://httpbin.org/deflate, but it returns a response with an empty body.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix

@joelwurtz
Copy link
Member

no BC break here for me, even if we remove some headers, it just was wrong and was not working so 👍

@sagikazarmark sagikazarmark merged commit 913b7eb into php-http:master Mar 17, 2017
@sagikazarmark
Copy link
Member

Thanks

@ajgarlag
Copy link
Contributor Author

Thank you all for you OSS work! A patch release would be useful!

@sagikazarmark
Copy link
Member

https://github.com/php-http/client-common/releases/tag/v1.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants