Skip to content

Commit cfa6186

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

11 files changed

+14
-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.2.2
610

711
### Changed

src/Input/SendTaskFailureInput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function request(): Request
8888
$headers = [
8989
'Content-Type' => 'application/x-amz-json-1.0',
9090
'X-Amz-Target' => 'AWSStepFunctions.SendTaskFailure',
91+
'Accept' => 'application/json',
9192
];
9293

9394
// Prepare query

src/Input/SendTaskHeartbeatInput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function request(): Request
5858
$headers = [
5959
'Content-Type' => 'application/x-amz-json-1.0',
6060
'X-Amz-Target' => 'AWSStepFunctions.SendTaskHeartbeat',
61+
'Accept' => 'application/json',
6162
];
6263

6364
// Prepare query

src/Input/SendTaskSuccessInput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function request(): Request
7676
$headers = [
7777
'Content-Type' => 'application/x-amz-json-1.0',
7878
'X-Amz-Target' => 'AWSStepFunctions.SendTaskSuccess',
79+
'Accept' => 'application/json',
7980
];
8081

8182
// Prepare query

src/Input/StartExecutionInput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public function request(): Request
147147
$headers = [
148148
'Content-Type' => 'application/x-amz-json-1.0',
149149
'X-Amz-Target' => 'AWSStepFunctions.StartExecution',
150+
'Accept' => 'application/json',
150151
];
151152

152153
// Prepare query

src/Input/StopExecutionInput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function request(): Request
8585
$headers = [
8686
'Content-Type' => 'application/x-amz-json-1.0',
8787
'X-Amz-Target' => 'AWSStepFunctions.StopExecution',
88+
'Accept' => 'application/json',
8889
];
8990

9091
// Prepare query

tests/Unit/Input/SendTaskFailureInputTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function testRequest(): void
2020
POST / HTTP/1.0
2121
Content-Type: application/x-amz-json-1.0
2222
X-Amz-Target: AWSStepFunctions.SendTaskFailure
23+
Accept: application/json
2324
2425
{
2526
"taskToken": "qwertyuiop",

tests/Unit/Input/SendTaskHeartbeatInputTest.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.0
2020
X-Amz-Target: AWSStepFunctions.SendTaskHeartbeat
21+
Accept: application/json
2122
2223
{
2324
"taskToken": "qwertyuiop"

tests/Unit/Input/SendTaskSuccessInputTest.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.0
2121
X-Amz-Target: AWSStepFunctions.SendTaskSuccess
22+
Accept: application/json
2223
2324
{
2425
"taskToken": "qwertyuiop",

tests/Unit/Input/StartExecutionInputTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function testRequest(): void
2020
POST / HTTP/1.0
2121
Content-Type: application/x-amz-json-1.0
2222
X-Amz-Target: AWSStepFunctions.StartExecution
23+
Accept: application/json
2324
2425
{
2526
"input": "{}",

tests/Unit/Input/StopExecutionInputTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function testRequest(): void
2020
POST / HTTP/1.0
2121
Content-Type: application/x-amz-json-1.0
2222
X-Amz-Target: AWSStepFunctions.StopExecution
23+
Accept: application/json
2324
2425
{
2526
"executionArn": "arn:foo",

0 commit comments

Comments
 (0)