Skip to content

Commit 0a033c5

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

9 files changed

+12
-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.0.2
610

711
### Changed

src/Input/CancelQueryRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function request(): Request
5555
$headers = [
5656
'Content-Type' => 'application/x-amz-json-1.0',
5757
'X-Amz-Target' => 'Timestream_20181101.CancelQuery',
58+
'Accept' => 'application/json',
5859
];
5960

6061
// Prepare query

src/Input/DescribeEndpointsRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function request(): Request
3737
$headers = [
3838
'Content-Type' => 'application/x-amz-json-1.0',
3939
'X-Amz-Target' => 'Timestream_20181101.DescribeEndpoints',
40+
'Accept' => 'application/json',
4041
];
4142

4243
// Prepare query

src/Input/PrepareQueryRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function request(): Request
7272
$headers = [
7373
'Content-Type' => 'application/x-amz-json-1.0',
7474
'X-Amz-Target' => 'Timestream_20181101.PrepareQuery',
75+
'Accept' => 'application/json',
7576
];
7677

7778
// Prepare query

src/Input/QueryRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public function request(): Request
139139
$headers = [
140140
'Content-Type' => 'application/x-amz-json-1.0',
141141
'X-Amz-Target' => 'Timestream_20181101.Query',
142+
'Accept' => 'application/json',
142143
];
143144

144145
// Prepare query

tests/Unit/Input/CancelQueryRequestTest.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: Timestream_20181101.CancelQuery
21+
Accept: application/json
2122
2223
{
2324
"QueryId": "qwertyuiop"

tests/Unit/Input/DescribeEndpointsRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function testRequest(): void
1717
POST / HTTP/1.0
1818
Content-Type: application/x-amz-json-1.0
1919
x-amz-target: Timestream_20181101.DescribeEndpoints
20+
Accept: application/json
2021
2122
{
2223
}

tests/Unit/Input/PrepareQueryRequestTest.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: Timestream_20181101.PrepareQuery
22+
Accept: application/json
2223
2324
{
2425
"QueryString": "SELECT * FROM db.tbl ORDER BY time DESC LIMIT 10",

tests/Unit/Input/QueryRequestTest.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: Timestream_20181101.Query
22+
Accept: application/json
2223
2324
{
2425
"ClientToken": "qwertyuiop",

0 commit comments

Comments
 (0)