diff --git a/src/Service.php b/src/Service.php index f3f5cf7..f30f35a 100644 --- a/src/Service.php +++ b/src/Service.php @@ -347,9 +347,9 @@ private function getJsonInput () : array } $input = json_decode($input, true); if (json_last_error() == JSON_ERROR_NONE) { - return []; + return $input; } - return $json; + return []; } public function run($method = false, $path = false, &$code = false) @@ -377,8 +377,8 @@ public function run($method = false, $path = false, &$code = false) try { http_response_code(200); ob_start(); - $input = array_unshift($route[2], $this->getJsonInput()); - $response = $this->execute($route[1], $input); + array_unshift($route[2], $this->getJsonInput()); + $response = $this->execute($route[1], $route[2]); if ($response === false) { $output = false; } else {