summaryrefslogtreecommitdiffstats
path: root/lib/api.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2013-01-16 20:27:35 +0000
committerTom Needham <needham.thomas@gmail.com>2013-01-16 20:27:43 +0000
commit098c84a29c5390608103d00cfeffa1422b621efe (patch)
treede8965233166ef0160660ab84b43ccf0254d7b0c /lib/api.php
parent3d23e983908d02fe72f305aeaabbdca05d167e8f (diff)
downloadnextcloud-server-098c84a29c5390608103d00cfeffa1422b621efe.tar.gz
nextcloud-server-098c84a29c5390608103d00cfeffa1422b621efe.zip
Return 401 headers when authentication is required for the api call
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api.php b/lib/api.php
index cb67e0c2a89..da0c2417dcf 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -94,6 +94,8 @@ class OC_API {
$response = new OC_OCS_Result(null, 998, 'Api method not found');
}
} else {
+ header('WWW-Authenticate: Basic realm="Authorisation Required"');
+ header('HTTP/1.0 401 Unauthorized');
$response = new OC_OCS_Result(null, 997, 'Unauthorised');
}
// Send the response