Skip to content

Commit

Permalink
Fix setting cURL request headers
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Oct 31, 2023
1 parent 758ae7f commit c24b43c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/HttpClient/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function sendRequest(string $requestData, Options $options): Response
&& $options->isHttpCompressionEnabled()
) {
$requestData = gzcompress($requestData, -1, \ZLIB_ENCODING_GZIP);
$requestHeaders['Content-Encoding'] = 'gzip';
$requestHeaders[] = 'Content-Encoding: gzip';

Check warning on line 47 in src/HttpClient/HttpClient.php

View check run for this annotation

Codecov / codecov/patch

src/HttpClient/HttpClient.php#L47

Added line #L47 was not covered by tests
}

$responseHeaders = [];
Expand Down
4 changes: 2 additions & 2 deletions src/Util/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public static function getRequestHeaders(Dsn $dsn, string $sdkIdentifier, string
];

return [
'Content-Type' => 'application/x-sentry-envelope',
'X-Sentry-Auth' => 'Sentry ' . implode(', ', $authHeader),
'Content-Type: application/x-sentry-envelope',
'X-Sentry-Auth: Sentry ' . implode(', ', $authHeader),
];
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Util/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public static function getRequestHeadersDataProvider(): \Generator
'sentry.sdk.identifier',
'1.2.3',
[
'Content-Type' => 'application/x-sentry-envelope',
'X-Sentry-Auth' => 'Sentry sentry_version=7, sentry_client=sentry.sdk.identifier/1.2.3, sentry_key=public',
'Content-Type: application/x-sentry-envelope',
'X-Sentry-Auth: Sentry sentry_version=7, sentry_client=sentry.sdk.identifier/1.2.3, sentry_key=public',
],
];
}
Expand Down

0 comments on commit c24b43c

Please sign in to comment.