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 e99e482 commit a550d51
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Changed

- Add `Accept: application/json` header in request to fix incompatibility with 3rd party providers
- AWS enhancement: Documentation updates.

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

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

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

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

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

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

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/CreateSecretRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
x-amz-target: secretsmanager.CreateSecret
Accept: application/json
{
"ClientRequestToken": "EXAMPLE1-90ab-cdef-fedc-ba987SECRET1",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/DeleteSecretRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
x-amz-target: secretsmanager.DeleteSecret
Accept: application/json
{
"RecoveryWindowInDays": 7,
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/GetSecretValueRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
x-amz-target: secretsmanager.GetSecretValue
Accept: application/json
{
"SecretId": "MyTestDatabaseSecret",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/ListSecretsRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
x-amz-target: secretsmanager.ListSecrets
Accept: application/json
{
"Filters": [
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/PutSecretValueRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
x-amz-target: secretsmanager.PutSecretValue
Accept: application/json
{
"ClientRequestToken": "EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/UpdateSecretRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.1
x-amz-target: secretsmanager.UpdateSecret
Accept: application/json
{
"ClientRequestToken": "EXAMPLE1-90ab-cdef-fedc-ba987EXAMPLE",
Expand Down

0 comments on commit a550d51

Please sign in to comment.