Skip to content

Commit

Permalink
Add an accept header in JSON request to help 3rd party services like …
Browse files Browse the repository at this point in the history
…localstack (#1721)
  • Loading branch information
jderusse committed Jun 5, 2024
1 parent 4073986 commit c35bc94
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Changed

- Add `Accept: application/json` header in request to fix incompatibility with 3rd party providers

## 1.1.0

### Added
Expand Down
5 changes: 4 additions & 1 deletion src/Input/PutTraceSegmentsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ public function getTraceSegmentDocuments(): array
public function request(): Request
{
// Prepare headers
$headers = ['content-type' => 'application/json'];
$headers = [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
];

// Prepare query
$query = [];
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Input/PutTraceSegmentsRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public function testRequest(): void
// see https://docs.aws.amazon.com/xray/latest/api/API_PutTraceSegments.html
$expected = '
POST /TraceSegments HTTP/1.0
Content-Type: application/json
Content-type: application/json
Accept: application/json
{
"TraceSegmentDocuments": [
Expand Down

0 comments on commit c35bc94

Please sign in to comment.