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
1 changed files with 1 additions and 2 deletions

View File

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