diff options
author | Andrew Dolgov <[email protected]> | 2017-02-26 18:14:59 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-02-26 18:14:59 +0300 |
commit | 4059638262e135e4497e3f790914bd9cc476389e (patch) | |
tree | 741384e60619122da1a92e89b17ab6ac75283a08 /backend.php | |
parent | 7c123353b57cb96d84fb7a6b311b0df1e56fa035 (diff) |
show 401 errors if no http auth user is present
Diffstat (limited to 'backend.php')
-rw-r--r-- | backend.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend.php b/backend.php index c7d7ebc..b7298fa 100644 --- a/backend.php +++ b/backend.php @@ -12,7 +12,8 @@ $owner = SQLite3::escapeString($_SERVER["PHP_AUTH_USER"]); if (!$owner) { - print json_encode(["error" => "NOT_AUTHENTICATED"]); + header($_SERVER["SERVER_PROTOCOL"]." 401 Unauthorized"); + echo "Unauthorized"; die; } |