From 57bcb14eca231300cf164b070bf27f854dc2211c Mon Sep 17 00:00:00 2001 From: Eugen Berencian Date: Thu, 14 Jul 2022 14:43:02 +0200 Subject: [PATCH] APPDEV-6880: headers to lowercase(http2 fix) --- src/FreshMail/Client.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/FreshMail/Client.php b/src/FreshMail/Client.php index 9beedbe..5a027de 100644 --- a/src/FreshMail/Client.php +++ b/src/FreshMail/Client.php @@ -95,8 +95,8 @@ public function doFileRequest(string $uri, array $params = []) $method = ($params) ? 'POST' : 'GET'; $response = $this->guzzle->request($method, $uri, $this->getRequestOptions($params)); - if ($response->getHeaderLine('Content-Type') !== 'application/zip') { - throw new ServerException(sprintf('Response content type is not supported: %s', $response->getHeaderLine('Content-Type'))); + if ($response->getHeaderLine('content-type') !== 'application/zip') { + throw new ServerException(sprintf('Response content type is not supported: %s', $response->getHeaderLine('content-type'))); } return $response->getBody()->getContents(); } catch (\GuzzleHttp\Exception\ClientException $exception) { @@ -135,10 +135,10 @@ private function getRequestOptions(array $requestData): array 'base_uri' => sprintf('%s://%s/%s/', self::SCHEME, self::HOST, self::PREFIX), RequestOptions::BODY => json_encode($requestData), RequestOptions::HEADERS => [ - 'Accept' => 'application/json', - 'Content-Type' => 'application/json', - 'Authorization' => 'Bearer ' . $this->bearerToken, - 'User-Agent' => $this->createUserAgent() + 'accept' => 'application/json', + 'content-type' => 'application/json', + 'authorization' => 'Bearer ' . $this->bearerToken, + 'user-agent' => $this->createUserAgent() ] ]; } @@ -157,4 +157,4 @@ private function createUserAgent(): string php_sapi_name() ); } -} +} \ No newline at end of file