From a8d95cb55b961d28e9a2d511f4caa3bf4448ad46 Mon Sep 17 00:00:00 2001 From: kj Date: Fri, 14 Apr 2023 16:43:50 -0400 Subject: [PATCH] Fix empty application/json. --- src/Libs/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libs/Router.php b/src/Libs/Router.php index a4697ab..8bbde5f 100644 --- a/src/Libs/Router.php +++ b/src/Libs/Router.php @@ -165,7 +165,7 @@ class Router { private static function get_json(): object { $contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : ''; 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) ''; }