Skip to content

Commit aae7500

Browse files
authored
Enforce JSON validity (#996)
1 parent 4801289 commit aae7500

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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+
### Fixed
6+
7+
- Assert the provided Input can be json-encoded.
8+
59
## 1.4.0
610

711
### Added

src/Input/AddLayerVersionPermissionRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function request(): Request
161161

162162
// Prepare Body
163163
$bodyPayload = $this->requestBody();
164-
$body = empty($bodyPayload) ? '{}' : json_encode($bodyPayload);
164+
$body = empty($bodyPayload) ? '{}' : \json_encode($bodyPayload, 4194304);
165165

166166
// Return the Request
167167
return new Request('POST', $uriString, $query, $headers, StreamFactory::create($body));

src/Input/PublishLayerVersionRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function request(): Request
126126

127127
// Prepare Body
128128
$bodyPayload = $this->requestBody();
129-
$body = empty($bodyPayload) ? '{}' : json_encode($bodyPayload);
129+
$body = empty($bodyPayload) ? '{}' : \json_encode($bodyPayload, 4194304);
130130

131131
// Return the Request
132132
return new Request('POST', $uriString, $query, $headers, StreamFactory::create($body));

0 commit comments

Comments
 (0)