Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Fix: decompressed response saved into file when streaming #199

Merged
merged 1 commit into from
Dec 2, 2019
Merged

Fix: decompressed response saved into file when streaming #199

merged 1 commit into from
Dec 2, 2019

Conversation

michalbundyra
Copy link
Member

  • Are you fixing a bug?
    • Detail how the bug is invoked currently.
    • Detail the original, incorrect behavior.
    • Detail the new, expected behavior.
    • Base your feature on the master branch, and submit against that branch.
    • Add a regression test that demonstrates the bug, and proves the fix.
    • Add a CHANGELOG.md entry for the fix.

When we set stream we'd like to get decompressed resource in the file.

Fixes #91

/cc @zerocrates

@michalbundyra michalbundyra added this to the 2.10.1 milestone Nov 29, 2019
@michalbundyra michalbundyra requested a review from Xerkus November 29, 2019 20:33
When we set stream we'd like to get decompressed resource in the file.

Fixes #91
@@ -1184,7 +1184,7 @@ protected function prepareHeaders($body, $uri)
// Set the Accept-encoding header if not set - depending on whether
// zlib is available or not.
if (! $this->getRequest()->getHeaders()->has('Accept-Encoding')) {
if (function_exists('gzinflate')) {
if (empty($this->config['outputstream']) && function_exists('gzinflate')) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious: can you explain why this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

See the test - we'd like to have uncompressed content stored in the file if we are using streams and we set the file.

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

🚢

@michalbundyra michalbundyra merged commit 90e8f4e into zendframework:master Dec 2, 2019
michalbundyra added a commit that referenced this pull request Dec 2, 2019
…esponse

Fix: decompressed response saved into file when streaming
michalbundyra added a commit that referenced this pull request Dec 2, 2019
michalbundyra added a commit that referenced this pull request Dec 2, 2019
michalbundyra added a commit that referenced this pull request Dec 2, 2019
@michalbundyra michalbundyra deleted the hotfix/stream-compressed-response branch December 2, 2019 16:13
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client, Socket adapter: compressed responses not decompressed when streaming
2 participants