Skip to content

Commit

Permalink
Added accept encoding gzip
Browse files Browse the repository at this point in the history
  • Loading branch information
slischka committed Sep 8, 2020
1 parent 35a968a commit 1c6814c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Fapi/HttpClient/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private function initializeCurl(RequestInterface $httpRequest)
\CURLOPT_CUSTOMREQUEST => $httpRequest->getMethod(),
\CURLOPT_RETURNTRANSFER => true,
\CURLOPT_HEADER => true,
\CURLOPT_ENCODING => 'gzip',
]);

return $handle;
Expand Down
3 changes: 2 additions & 1 deletion src/Fapi/HttpClient/GuzzleHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public function sendRequest(RequestInterface $request): ResponseInterface
$options = $this->processOptions($request);
$request = $request->withoutHeader('timeout')
->withoutHeader('connect_timeout')
->withoutHeader('verify');
->withoutHeader('verify')
->withHeader('Accept-Encoding', 'gzip');

try {
$response = $this->client->send($request, $options + $this->getDefaultOptions());
Expand Down

0 comments on commit 1c6814c

Please sign in to comment.