Adding a proper Content-Type to err()

This commit is contained in:
Lispum
2017-05-14 20:04:27 +02:00
committed by GitHub
parent de52e7ee61
commit 6f4fe2444b
+1
View File
@@ -160,6 +160,7 @@ function get_absolute_path($path) {
function err($code,$msg) {
http_response_code($code);
header("Content-Type: application/json");
echo json_encode(['error' => ['code'=>intval($code), 'msg' => $msg]]);
exit;
}