From 1c6814c1aeccba750557cfd97637a4dc528c366b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Slischka?= Date: Tue, 8 Sep 2020 15:02:57 +0200 Subject: [PATCH] Added accept encoding gzip --- src/Fapi/HttpClient/CurlHttpClient.php | 1 + src/Fapi/HttpClient/GuzzleHttpClient.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fapi/HttpClient/CurlHttpClient.php b/src/Fapi/HttpClient/CurlHttpClient.php index c0e9073..d7173f5 100644 --- a/src/Fapi/HttpClient/CurlHttpClient.php +++ b/src/Fapi/HttpClient/CurlHttpClient.php @@ -64,6 +64,7 @@ private function initializeCurl(RequestInterface $httpRequest) \CURLOPT_CUSTOMREQUEST => $httpRequest->getMethod(), \CURLOPT_RETURNTRANSFER => true, \CURLOPT_HEADER => true, + \CURLOPT_ENCODING => 'gzip', ]); return $handle; diff --git a/src/Fapi/HttpClient/GuzzleHttpClient.php b/src/Fapi/HttpClient/GuzzleHttpClient.php index 58798f8..2b8d158 100644 --- a/src/Fapi/HttpClient/GuzzleHttpClient.php +++ b/src/Fapi/HttpClient/GuzzleHttpClient.php @@ -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());