Skip to content

Commit e26cd9d

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

19 files changed

+58
-18
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.5.0
610

711
### Added

src/Input/AddLayerVersionPermissionRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ public function getVersionNumber(): ?int
153153
public function request(): Request
154154
{
155155
// Prepare headers
156-
$headers = ['content-type' => 'application/json'];
156+
$headers = [
157+
'Content-Type' => 'application/json',
158+
'Accept' => 'application/json',
159+
];
157160

158161
// Prepare query
159162
$query = [];

src/Input/DeleteFunctionRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ public function getQualifier(): ?string
7676
public function request(): Request
7777
{
7878
// Prepare headers
79-
$headers = ['content-type' => 'application/json'];
79+
$headers = [
80+
'Content-Type' => 'application/json',
81+
'Accept' => 'application/json',
82+
];
8083

8184
// Prepare query
8285
$query = [];

src/Input/GetFunctionConfigurationRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ public function getQualifier(): ?string
7676
public function request(): Request
7777
{
7878
// Prepare headers
79-
$headers = ['content-type' => 'application/json'];
79+
$headers = [
80+
'Content-Type' => 'application/json',
81+
'Accept' => 'application/json',
82+
];
8083

8184
// Prepare query
8285
$query = [];

src/Input/InvocationRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ public function getQualifier(): ?string
154154
public function request(): Request
155155
{
156156
// Prepare headers
157-
$headers = ['content-type' => 'application/json'];
157+
$headers = [
158+
'Content-Type' => 'application/json',
159+
'Accept' => 'application/json',
160+
];
158161
if (null !== $this->invocationType) {
159162
if (!InvocationType::exists($this->invocationType)) {
160163
throw new InvalidArgument(sprintf('Invalid parameter "InvocationType" for "%s". The value "%s" is not a valid "InvocationType".', __CLASS__, $this->invocationType));

src/Input/ListFunctionsRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ public function getMaxItems(): ?int
102102
public function request(): Request
103103
{
104104
// Prepare headers
105-
$headers = ['content-type' => 'application/json'];
105+
$headers = [
106+
'Content-Type' => 'application/json',
107+
'Accept' => 'application/json',
108+
];
106109

107110
// Prepare query
108111
$query = [];

src/Input/ListLayerVersionsRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ public function getMaxItems(): ?int
126126
public function request(): Request
127127
{
128128
// Prepare headers
129-
$headers = ['content-type' => 'application/json'];
129+
$headers = [
130+
'Content-Type' => 'application/json',
131+
'Accept' => 'application/json',
132+
];
130133

131134
// Prepare query
132135
$query = [];

src/Input/ListVersionsByFunctionRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ public function getMaxItems(): ?int
9292
public function request(): Request
9393
{
9494
// Prepare headers
95-
$headers = ['content-type' => 'application/json'];
95+
$headers = [
96+
'Content-Type' => 'application/json',
97+
'Accept' => 'application/json',
98+
];
9699

97100
// Prepare query
98101
$query = [];

src/Input/PublishLayerVersionRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ public function getLicenseInfo(): ?string
151151
public function request(): Request
152152
{
153153
// Prepare headers
154-
$headers = ['content-type' => 'application/json'];
154+
$headers = [
155+
'Content-Type' => 'application/json',
156+
'Accept' => 'application/json',
157+
];
155158

156159
// Prepare query
157160
$query = [];

src/Input/UpdateFunctionConfigurationRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,10 @@ public function getVpcConfig(): ?VpcConfig
393393
public function request(): Request
394394
{
395395
// Prepare headers
396-
$headers = ['content-type' => 'application/json'];
396+
$headers = [
397+
'Content-Type' => 'application/json',
398+
'Accept' => 'application/json',
399+
];
397400

398401
// Prepare query
399402
$query = [];

0 commit comments

Comments
 (0)