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 ae43fc5 commit 8ed73fe
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 0 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

## 2.1.2

### Changed
Expand Down
1 change: 1 addition & 0 deletions src/Input/DeleteParameterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function request(): Request
$headers = [
'Content-Type' => 'application/x-amz-json-1.1',
'X-Amz-Target' => 'AmazonSSM.DeleteParameter',
'Accept' => 'application/json',
];

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions src/Input/DeleteParametersRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function request(): Request
$headers = [
'Content-Type' => 'application/x-amz-json-1.1',
'X-Amz-Target' => 'AmazonSSM.DeleteParameters',
'Accept' => 'application/json',
];

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions src/Input/GetParameterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function request(): Request
$headers = [
'Content-Type' => 'application/x-amz-json-1.1',
'X-Amz-Target' => 'AmazonSSM.GetParameter',
'Accept' => 'application/json',
];

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions src/Input/GetParametersByPathRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public function request(): Request
$headers = [
'Content-Type' => 'application/x-amz-json-1.1',
'X-Amz-Target' => 'AmazonSSM.GetParametersByPath',
'Accept' => 'application/json',
];

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions src/Input/GetParametersRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function request(): Request
$headers = [
'Content-Type' => 'application/x-amz-json-1.1',
'X-Amz-Target' => 'AmazonSSM.GetParameters',
'Accept' => 'application/json',
];

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions src/Input/PutParameterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ public function request(): Request
$headers = [
'Content-Type' => 'application/x-amz-json-1.1',
'X-Amz-Target' => 'AmazonSSM.PutParameter',
'Accept' => 'application/json',
];

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/DeleteParameterRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AmazonSSM.DeleteParameter
Accept: application/json
{
"Name": "EC2DevServerType"
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/DeleteParametersRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AmazonSSM.DeleteParameters
Accept: application/json
{
"Names": [
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/GetParameterRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AmazonSSM.GetParameter
Accept: application/json
{
"Name": "MyGitHubPassword"
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/GetParametersByPathRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AmazonSSM.GetParametersByPath
Accept: application/json
{
"Path": "/Branch312/Dev/",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/GetParametersRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AmazonSSM.GetParameters
Accept: application/json
{
"Names": [
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/PutParameterRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AmazonSSM.PutParameter
Accept: application/json
{
"Overwrite": true,
Expand Down

0 comments on commit 8ed73fe

Please sign in to comment.