Skip to content

Commit b57af12

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

17 files changed

+20
-0
lines changed

CHANGELOG.md

+4
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.1.1
610

711
### Changed

src/Input/CreateRepositoryInput.php

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public function request(): Request
124124
$headers = [
125125
'Content-Type' => 'application/x-amz-json-1.1',
126126
'X-Amz-Target' => 'CodeCommit_20150413.CreateRepository',
127+
'Accept' => 'application/json',
127128
];
128129

129130
// Prepare query

src/Input/DeleteRepositoryInput.php

+1
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.1',
6060
'X-Amz-Target' => 'CodeCommit_20150413.DeleteRepository',
61+
'Accept' => 'application/json',
6162
];
6263

6364
// Prepare query

src/Input/GetBlobInput.php

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function request(): Request
7575
$headers = [
7676
'Content-Type' => 'application/x-amz-json-1.1',
7777
'X-Amz-Target' => 'CodeCommit_20150413.GetBlob',
78+
'Accept' => 'application/json',
7879
];
7980

8081
// Prepare query

src/Input/GetBranchInput.php

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function request(): Request
7070
$headers = [
7171
'Content-Type' => 'application/x-amz-json-1.1',
7272
'X-Amz-Target' => 'CodeCommit_20150413.GetBranch',
73+
'Accept' => 'application/json',
7374
];
7475

7576
// Prepare query

src/Input/GetCommitInput.php

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function request(): Request
7575
$headers = [
7676
'Content-Type' => 'application/x-amz-json-1.1',
7777
'X-Amz-Target' => 'CodeCommit_20150413.GetCommit',
78+
'Accept' => 'application/json',
7879
];
7980

8081
// Prepare query

src/Input/GetDifferencesInput.php

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function request(): Request
152152
$headers = [
153153
'Content-Type' => 'application/x-amz-json-1.1',
154154
'X-Amz-Target' => 'CodeCommit_20150413.GetDifferences',
155+
'Accept' => 'application/json',
155156
];
156157

157158
// Prepare query

src/Input/ListRepositoriesInput.php

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public function request(): Request
9696
$headers = [
9797
'Content-Type' => 'application/x-amz-json-1.1',
9898
'X-Amz-Target' => 'CodeCommit_20150413.ListRepositories',
99+
'Accept' => 'application/json',
99100
];
100101

101102
// Prepare query

src/Input/PutRepositoryTriggersInput.php

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function request(): Request
7979
$headers = [
8080
'Content-Type' => 'application/x-amz-json-1.1',
8181
'X-Amz-Target' => 'CodeCommit_20150413.PutRepositoryTriggers',
82+
'Accept' => 'application/json',
8283
];
8384

8485
// Prepare query

tests/Unit/Input/CreateRepositoryInputTest.php

+1
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.1
2222
x-amz-target: CodeCommit_20150413.CreateRepository
23+
Accept: application/json
2324
2425
{
2526
"repositoryDescription": "this is the project that will finally make me rich!",

tests/Unit/Input/DeleteRepositoryInputTest.php

+1
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.1
2020
x-amz-target: CodeCommit_20150413.DeleteRepository
21+
Accept: application/json
2122
2223
{
2324
"repositoryName": "repo-i-no-longer-care-about"

tests/Unit/Input/GetBlobInputTest.php

+1
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.1
2121
x-amz-target: CodeCommit_20150413.GetBlob
22+
Accept: application/json
2223
2324
{
2425
"repositoryName": "MyFirstRepository",

tests/Unit/Input/GetBranchInputTest.php

+1
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.1
2121
x-amz-target: CodeCommit_20150413.GetBranch
22+
Accept: application/json
2223
2324
{
2425
"repositoryName": "MyFirstRepository",

tests/Unit/Input/GetCommitInputTest.php

+1
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.1
2121
x-amz-target: CodeCommit_20150413.GetCommit
22+
Accept: application/json
2223
2324
{
2425
"commitId": "b58c341f3d493f7fc0b6b95a648a2e2397d0692f",

tests/Unit/Input/GetDifferencesInputTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function testRequest(): void
2424
POST / HTTP/1.0
2525
Content-Type: application/x-amz-json-1.1
2626
x-amz-target: CodeCommit_20150413.GetDifferences
27+
Accept: application/json
2728
2829
{
2930
"MaxResults": 1337,

tests/Unit/Input/ListRepositoriesInputTest.php

+1
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.1
2222
x-amz-target: CodeCommit_20150413.ListRepositories
23+
Accept: application/json
2324
2425
{
2526
"nextToken": "NEXT_TOK",

tests/Unit/Input/PutRepositoryTriggersInputTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function testRequest(): void
2626
POST / HTTP/1.0
2727
Content-Type: application/x-amz-json-1.1
2828
x-amz-target: CodeCommit_20150413.PutRepositoryTriggers
29+
Accept: application/json
2930
3031
{
3132
"repositoryName": "my-super-code-repository",

0 commit comments

Comments
 (0)