Skip to content

Commit 8ed73fe

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

13 files changed

+16
-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
## 2.1.2
610

711
### Changed

src/Input/DeleteParameterRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function request(): Request
5757
$headers = [
5858
'Content-Type' => 'application/x-amz-json-1.1',
5959
'X-Amz-Target' => 'AmazonSSM.DeleteParameter',
60+
'Accept' => 'application/json',
6061
];
6162

6263
// Prepare query

src/Input/DeleteParametersRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function request(): Request
6161
$headers = [
6262
'Content-Type' => 'application/x-amz-json-1.1',
6363
'X-Amz-Target' => 'AmazonSSM.DeleteParameters',
64+
'Accept' => 'application/json',
6465
];
6566

6667
// Prepare query

src/Input/GetParameterRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function request(): Request
7979
$headers = [
8080
'Content-Type' => 'application/x-amz-json-1.1',
8181
'X-Amz-Target' => 'AmazonSSM.GetParameter',
82+
'Accept' => 'application/json',
8283
];
8384

8485
// Prepare query

src/Input/GetParametersByPathRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public function request(): Request
148148
$headers = [
149149
'Content-Type' => 'application/x-amz-json-1.1',
150150
'X-Amz-Target' => 'AmazonSSM.GetParametersByPath',
151+
'Accept' => 'application/json',
151152
];
152153

153154
// Prepare query

src/Input/GetParametersRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public function request(): Request
8484
$headers = [
8585
'Content-Type' => 'application/x-amz-json-1.1',
8686
'X-Amz-Target' => 'AmazonSSM.GetParameters',
87+
'Accept' => 'application/json',
8788
];
8889

8990
// Prepare query

src/Input/PutParameterRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ public function request(): Request
367367
$headers = [
368368
'Content-Type' => 'application/x-amz-json-1.1',
369369
'X-Amz-Target' => 'AmazonSSM.PutParameter',
370+
'Accept' => 'application/json',
370371
];
371372

372373
// Prepare query

tests/Unit/Input/DeleteParameterRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function testRequest(): void
1818
POST / HTTP/1.0
1919
Content-Type: application/x-amz-json-1.1
2020
X-Amz-Target: AmazonSSM.DeleteParameter
21+
Accept: application/json
2122
2223
{
2324
"Name": "EC2DevServerType"

tests/Unit/Input/DeleteParametersRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function testRequest(): void
1818
POST / HTTP/1.0
1919
Content-Type: application/x-amz-json-1.1
2020
X-Amz-Target: AmazonSSM.DeleteParameters
21+
Accept: application/json
2122
2223
{
2324
"Names": [

tests/Unit/Input/GetParameterRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function testRequest(): void
1818
POST / HTTP/1.0
1919
Content-Type: application/x-amz-json-1.1
2020
X-Amz-Target: AmazonSSM.GetParameter
21+
Accept: application/json
2122
2223
{
2324
"Name": "MyGitHubPassword"

0 commit comments

Comments
 (0)