Skip to content
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

Fix CURLOPT_ENCODING not to be overwritten #2595

Merged
merged 2 commits into from
Oct 9, 2020

Conversation

YoakeSakura
Copy link
Contributor

This PR fixes an issue where CURLOPT_ENCODING is overwritten when decode_content is true (default is true).

Before this fix, setting only CURLOPT_ENCODING removes the Accept-Encoding header and the server response is not compressed.
After this fix, the Accept-Encoding header is sent and the server response is compressed.

Maybe this will solve that issue #2270

@Nyholm
Copy link
Member

Nyholm commented Jun 27, 2020

This needs a rebase and a test.

Also make sure CI is green

@gmponos gmponos added this to the 7.1.0 milestone Jun 27, 2020
@Nyholm
Copy link
Member

Nyholm commented Aug 13, 2020

Friendly ping

@Nyholm
Copy link
Member

Nyholm commented Sep 19, 2020

Ping ping =)

@Nyholm Nyholm modified the milestones: 7.1.0, 7.2.0 Sep 19, 2020
@Nyholm Nyholm added status/wip lifecycle/keep-open Issues that should not be closed labels Sep 22, 2020
@Nyholm
Copy link
Member

Nyholm commented Oct 1, 2020

@YoakeSakura will you finish this PR?

@YoakeSakura
Copy link
Contributor Author

Thanks for the ping, sorry for the delay.
I added the test code.
MockHandler could not test the request headers that cURL adds.
So I'm testing with Server and MockHandler.

Incidentally, I think it's a good idea to add an option to automatically set the compression that cURL can support.
Now the only way to do that is to set it as a cURL option.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. So if you specify $options['curl'][\CURLOPT_ENCODING] you dont want Guzzle to override it with data from the Accept-Encoding heading.

@Nyholm Nyholm merged commit 368bf4d into guzzle:master Oct 9, 2020
@Nyholm
Copy link
Member

Nyholm commented Oct 9, 2020

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/keep-open Issues that should not be closed Review wanted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants