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 04a30af commit a0c4617
Show file tree
Hide file tree
Showing 27 changed files with 30 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.0

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

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

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

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

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

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions src/Input/DeleteQueueRequest.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.0',
'X-Amz-Target' => 'AmazonSQS.DeleteQueue',
'Accept' => 'application/json',
];

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

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

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

// Prepare query
Expand Down
1 change: 1 addition & 0 deletions src/Input/PurgeQueueRequest.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.0',
'X-Amz-Target' => 'AmazonSQS.PurgeQueue',
'Accept' => 'application/json',
];

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

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

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

// Prepare query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.0
x-amz-target: AmazonSQS.ChangeMessageVisibilityBatch
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/ChangeMessageVisibilityRequestTest.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.0
x-amz-target: AmazonSQS.ChangeMessageVisibility
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/CreateQueueRequestTest.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.0
x-amz-target: AmazonSQS.CreateQueue
Accept: application/json
{
"QueueName":"MyQueue",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/DeleteMessageBatchRequestTest.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.0
x-amz-target: AmazonSQS.DeleteMessageBatch
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/DeleteMessageRequestTest.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.0
x-amz-target: AmazonSQS.DeleteMessage
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/DeleteQueueRequestTest.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.0
x-amz-target: AmazonSQS.DeleteQueue
Accept: application/json
{
"QueueUrl":"queueUrl"
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/GetQueueAttributesRequestTest.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.0
x-amz-target: AmazonSQS.GetQueueAttributes
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/GetQueueUrlRequestTest.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.0
x-amz-target: AmazonSQS.GetQueueUrl
Accept: application/json
{
"QueueName": "MyQueue",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/ListQueuesRequestTest.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.0
x-amz-target: AmazonSQS.ListQueues
Accept: application/json
{
"QueueNamePrefix": "M"
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/PurgeQueueRequestTest.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.0
x-amz-target: AmazonSQS.PurgeQueue
Accept: application/json
{
"QueueUrl": "queueUrl"
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/ReceiveMessageRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.0
x-amz-target: AmazonSQS.ReceiveMessage
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/SendMessageBatchRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function testRequest(): void
POST / HTTP/1.0
Content-Type: application/x-amz-json-1.0
x-amz-target: AmazonSQS.SendMessageBatch
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Input/SendMessageRequestTest.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.0
x-amz-target: AmazonSQS.SendMessage
Accept: application/json
{
"QueueUrl": "queueUrl",
Expand Down

0 comments on commit a0c4617

Please sign in to comment.