Skip to content

Commit d0daaac

Browse files
h4kunapionl
authored andcommitted
fix(MakeBodyFromResponseAction): remove header if content is decoded
1 parent 9f14a20 commit d0daaac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Actions/MakeBodyFromResponseAction.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public function execute(string $responseClass, ResponseInterface $response): ?Ge
2727

2828
$encoding = strtolower($response->getHeaderLine('Content-Encoding'));
2929
if ($encoding === 'gzip' || $encoding === 'deflate') {
30-
$response = $response->withBody(new InflateStream($response->getBody()));
30+
$response = $response
31+
->withBody(new InflateStream($response->getBody()))
32+
->withoutHeader('Content-Encoding');
3133
}
3234

3335
if (array_key_exists(BodyIsJsonInterface::class, $implements)) {

0 commit comments

Comments
 (0)