Returning status code also as HTTP header

This commit is contained in:
Timo Ley 2020-10-10 13:41:03 +02:00
parent 1b52881fb5
commit d2c0ffca8b

View file

@ -179,10 +179,9 @@ if ($method == "GET") {
case "/admin": case "/admin":
admin(file_get_contents("php://input")); admin(file_get_contents("php://input"));
} }
} }
header('Content-Type: application/json'); header('Content-Type: application/json');
http_response_code($obj->status);
echo stripslashes(json_encode($obj, JSON_UNESCAPED_UNICODE)); echo stripslashes(json_encode($obj, JSON_UNESCAPED_UNICODE));
function endpoints() { function endpoints() {