Skip to content

Commit

Permalink
Fix patch method not getting parameters back
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ilic <[email protected]>
  • Loading branch information
gigili committed Jul 25, 2021
1 parent c56d2a4 commit d142ab5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ class Request
public function __construct()
{
$input = json_decode(file_get_contents('php://input')) ?? [];
if ( $_SERVER['REQUEST_METHOD'] == 'PATCH' ) {
if ( isset($_REQUEST["parameters"]) ) {
$_REQUEST = array_merge($_REQUEST, $_REQUEST['parameters']);
}

if ( isset($_REQUEST["files"]) ) {
$_REQUEST = array_merge($_REQUEST, $_REQUEST['files']);
}
}
$_REQUEST = array_merge($_REQUEST, (array)$input);
$this->data = $_REQUEST;
}
Expand Down

0 comments on commit d142ab5

Please sign in to comment.