Fix empty application/json.
This commit is contained in:
parent
06b7907f7c
commit
a8d95cb55b
@ -165,7 +165,7 @@ class Router {
|
|||||||
private static function get_json(): object {
|
private static function get_json(): object {
|
||||||
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';
|
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';
|
||||||
if ($contentType === "application/json") {
|
if ($contentType === "application/json") {
|
||||||
return json_decode(trim(file_get_contents("php://input")));
|
return (object) json_decode(trim(file_get_contents("php://input")));
|
||||||
}
|
}
|
||||||
return (object) '';
|
return (object) '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user