Skip to content

Commit e2fbe13

Browse files
authored
Add an accept header in JSON request to help 3rd party services like localstack (#1721)
1 parent b8dd02c commit e2fbe13

15 files changed

+18
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Changed
6+
7+
- Add `Accept: application/json` header in request to fix incompatibility with 3rd party providers
8+
59
## 1.4.0
610

711
### Added

src/Input/CreateAliasRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public function request(): Request
9999
$headers = [
100100
'Content-Type' => 'application/x-amz-json-1.1',
101101
'X-Amz-Target' => 'TrentService.CreateAlias',
102+
'Accept' => 'application/json',
102103
];
103104

104105
// Prepare query

src/Input/CreateKeyRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ public function request(): Request
423423
$headers = [
424424
'Content-Type' => 'application/x-amz-json-1.1',
425425
'X-Amz-Target' => 'TrentService.CreateKey',
426+
'Accept' => 'application/json',
426427
];
427428

428429
// Prepare query

src/Input/DecryptRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public function request(): Request
221221
$headers = [
222222
'Content-Type' => 'application/x-amz-json-1.1',
223223
'X-Amz-Target' => 'TrentService.Decrypt',
224+
'Accept' => 'application/json',
224225
];
225226

226227
// Prepare query

src/Input/EncryptRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public function request(): Request
190190
$headers = [
191191
'Content-Type' => 'application/x-amz-json-1.1',
192192
'X-Amz-Target' => 'TrentService.Encrypt',
193+
'Accept' => 'application/json',
193194
];
194195

195196
// Prepare query

src/Input/GenerateDataKeyRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ public function request(): Request
220220
$headers = [
221221
'Content-Type' => 'application/x-amz-json-1.1',
222222
'X-Amz-Target' => 'TrentService.GenerateDataKey',
223+
'Accept' => 'application/json',
223224
];
224225

225226
// Prepare query

src/Input/ListAliasesRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public function request(): Request
9999
$headers = [
100100
'Content-Type' => 'application/x-amz-json-1.1',
101101
'X-Amz-Target' => 'TrentService.ListAliases',
102+
'Accept' => 'application/json',
102103
];
103104

104105
// Prepare query

src/Input/SignRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ public function request(): Request
202202
$headers = [
203203
'Content-Type' => 'application/x-amz-json-1.1',
204204
'X-Amz-Target' => 'TrentService.Sign',
205+
'Accept' => 'application/json',
205206
];
206207

207208
// Prepare query

tests/Unit/Input/CreateAliasRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function testRequest(): void
1919
POST / HTTP/1.0
2020
Content-Type: application/x-amz-json-1.1
2121
x-amz-target: TrentService.CreateAlias
22+
Accept: application/json
2223
2324
{
2425
"AliasName": "alias\\/ExampleAlias",

tests/Unit/Input/CreateKeyRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function testRequest(): void
3030
POST / HTTP/1.0
3131
Content-Type: application/x-amz-json-1.1
3232
x-amz-target: TrentService.CreateKey
33+
Accept: application/json
3334
3435
{
3536
"Description": "My key",

0 commit comments

Comments
 (0)