Skip to content

Commit be14879

Browse files
committed
Don't unset the inflate resource on close as it might still be needed
1 parent dbd8ba6 commit be14879

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Test/Fixtures/web/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363
header('Content-Type: application/json', true, 404);
6464
break;
6565

66+
case '/404-gzipped':
67+
header('Content-Type: text/plain', true, 404);
68+
ob_start('ob_gzhandler');
69+
echo 'some text';
70+
exit;
71+
6672
case '/301':
6773
if ('Basic Zm9vOmJhcg==' === $vars['HTTP_AUTHORIZATION']) {
6874
header('Location: http://127.0.0.1:8057/302', true, 301);

Test/HttpClientTestCase.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,18 @@ public function testGetContentAfterDestruct()
835835
}
836836
}
837837

838+
public function testGetEncodedContentAfterDestruct()
839+
{
840+
$client = $this->getHttpClient(__FUNCTION__);
841+
842+
try {
843+
$client->request('GET', 'http://localhost:8057/404-gzipped');
844+
$this->fail(ClientExceptionInterface::class.' expected');
845+
} catch (ClientExceptionInterface $e) {
846+
$this->assertSame('some text', $e->getResponse()->getContent(false));
847+
}
848+
}
849+
838850
public function testProxy()
839851
{
840852
$client = $this->getHttpClient(__FUNCTION__);

0 commit comments

Comments
 (0)