Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/FreshMail/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
]
];
}
Expand All @@ -157,4 +157,4 @@ private function createUserAgent(): string
php_sapi_name()
);
}
}
}