Skip to content

Fix content deflating for IIS HTTP responses - #71

Merged
Ocramius merged 4 commits into
laminas:2.16.xfrom
blat:2.16.x
Nov 11, 2022
Merged

Fix content deflating for IIS HTTP responses #71
Ocramius merged 4 commits into
laminas:2.16.xfrom
blat:2.16.x

Conversation

@blat

@blat blat commented Nov 7, 2022

Copy link
Copy Markdown
Contributor
Q A
Bugfix yes
BC Break no

Description

Some response coming from IIS are using gzuncompress instead of gzinflate.

Note: This fix was already fixed 10 years ago on ZF1 zendframework/zf1@1e158aa but this this was not ported in ZF2.
See: https://framework.zend.com/issues/browse/ZF-12457.html

To reproduce:

use Laminas\Http\Client;
$client = new Client('https://www.vnews.com/With-Federal-Money-Running-Out-Lebanon-Starts-to-Pick-Up-Motel-Tabs-for-Homeless-48667855');
echo $client->send()->getBody();

Current result:

PHP Warning: gzuncompress(): data error in vendor/laminas/laminas-http/src/Response.php on line 653

@Ocramius Ocramius added the Bug Something isn't working label Nov 7, 2022
@Ocramius Ocramius added this to the 2.16.1 milestone Nov 7, 2022
Comment thread src/Response.php
@froschdesign

Copy link
Copy Markdown
Member

@blat
You are using the wrong branch because 2.17.0 is the last release, not 2.16.
See also in the contributing guidelines: What branch to issue the pull request against?

@blat

blat commented Nov 8, 2022

Copy link
Copy Markdown
Contributor Author

@froschdesign

PHP7 is not supported by 2.17.x release.
No plan for a 2.16.1?

@froschdesign

Copy link
Copy Markdown
Member

PHP7 is not supported by 2.17.x release.

Why? PHP 7 is dead.

@blat

blat commented Nov 8, 2022

Copy link
Copy Markdown
Contributor Author

Yes, I know PHP7 will be EOL at the end of the month. I'm current working on this upgrade ;)
In the meantime, a 2.16.1 will be appreciated!

@Ocramius Ocramius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some minor adjustments needed.

@froschdesign I'd be OK with merging this to an old-stable, as an exception: the contributor has put time to fix in it, and the merge-up should be straightforward too. WDYT?

Comment thread test/ResponseTest.php
Comment thread src/Response.php
@froschdesign

Copy link
Copy Markdown
Member

@Ocramius

…the contributor has put time to fix in it, and the merge-up should be straightforward too.

I agree with that. 👍🏻

@blat

blat commented Nov 9, 2022

Copy link
Copy Markdown
Contributor Author

I've updated with the smaller example I was able to found.

Thank you!

@Ocramius Ocramius self-assigned this Nov 11, 2022

@Ocramius Ocramius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @blat! Releasing now :)

@Ocramius Ocramius changed the title Fix Response::decodeDeflate Fix content deflating for IIS HTTP responses Nov 11, 2022
@Ocramius
Ocramius merged commit 838825d into laminas:2.16.x Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants