Skip to content

Commit f68c391

Browse files
committed
fix: response body decoding as assc array but it shouldn't
1 parent f389a73 commit f68c391

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Http/Request/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function validate($rules, $messages = null, $attributeLabels = null)
200200
$response = [
201201
'status' => 'error',
202202
'code' => 'VALIDATION',
203-
'data' => $validator->errors()
203+
'data' => $validator->errors(),
204204
];
205205

206206
wp_send_json($response, 422);
@@ -239,7 +239,7 @@ private function setBody($body = [])
239239
strpos($this->contentType(), 'form-data') === false
240240
&& strpos($this->contentType(), 'x-www-form-urlencoded') === false
241241
) {
242-
$this->_body = JSON::maybeDecode(file_get_contents('php://input'), true);
242+
$this->_body = JSON::maybeDecode(file_get_contents('php://input'));
243243
}
244244

245245
$this->_body = (array) $this->_body + (array) $_POST;

0 commit comments

Comments
 (0)