Skip to content

Commit

Permalink
fix(MakeBodyFromResponseAction): remove header if content is decoded
Browse files Browse the repository at this point in the history
  • Loading branch information
h4kuna authored and pionl committed Mar 19, 2024
1 parent 9f14a20 commit d0daaac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Actions/MakeBodyFromResponseAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public function execute(string $responseClass, ResponseInterface $response): ?Ge

$encoding = strtolower($response->getHeaderLine('Content-Encoding'));
if ($encoding === 'gzip' || $encoding === 'deflate') {
$response = $response->withBody(new InflateStream($response->getBody()));
$response = $response
->withBody(new InflateStream($response->getBody()))
->withoutHeader('Content-Encoding');
}

if (array_key_exists(BodyIsJsonInterface::class, $implements)) {
Expand Down

0 comments on commit d0daaac

Please sign in to comment.