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 authored Jun 5, 2024
1 parent 9bf4873 commit 1a7f953
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.8.0

### Added
Expand Down
5 changes: 4 additions & 1 deletion src/Input/SendEmailRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ public function getReplyToAddresses(): 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/SendEmailRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public function testRequest(): void
// see example-1.json from SDK
$expected = '
POST /v2/email/outbound-emails HTTP/1.0
Content-Type: application/json
Content-type: application/json
Accept: application/json
{
"FromEmailAddress": "jeremy@derusse.com",
Expand Down

0 comments on commit 1a7f953

Please sign in to comment.