Skip to content

Commit 57bcb14

Browse files
author
Eugen Berencian
committed
APPDEV-6880: headers to lowercase(http2 fix)
1 parent 34ebc5b commit 57bcb14

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/FreshMail/Client.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public function doFileRequest(string $uri, array $params = [])
9595
$method = ($params) ? 'POST' : 'GET';
9696

9797
$response = $this->guzzle->request($method, $uri, $this->getRequestOptions($params));
98-
if ($response->getHeaderLine('Content-Type') !== 'application/zip') {
99-
throw new ServerException(sprintf('Response content type is not supported: %s', $response->getHeaderLine('Content-Type')));
98+
if ($response->getHeaderLine('content-type') !== 'application/zip') {
99+
throw new ServerException(sprintf('Response content type is not supported: %s', $response->getHeaderLine('content-type')));
100100
}
101101
return $response->getBody()->getContents();
102102
} catch (\GuzzleHttp\Exception\ClientException $exception) {
@@ -135,10 +135,10 @@ private function getRequestOptions(array $requestData): array
135135
'base_uri' => sprintf('%s://%s/%s/', self::SCHEME, self::HOST, self::PREFIX),
136136
RequestOptions::BODY => json_encode($requestData),
137137
RequestOptions::HEADERS => [
138-
'Accept' => 'application/json',
139-
'Content-Type' => 'application/json',
140-
'Authorization' => 'Bearer ' . $this->bearerToken,
141-
'User-Agent' => $this->createUserAgent()
138+
'accept' => 'application/json',
139+
'content-type' => 'application/json',
140+
'authorization' => 'Bearer ' . $this->bearerToken,
141+
'user-agent' => $this->createUserAgent()
142142
]
143143
];
144144
}
@@ -157,4 +157,4 @@ private function createUserAgent(): string
157157
php_sapi_name()
158158
);
159159
}
160-
}
160+
}

0 commit comments

Comments
 (0)