From 098c84a29c5390608103d00cfeffa1422b621efe Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Wed, 16 Jan 2013 20:27:35 +0000 Subject: Return 401 headers when authentication is required for the api call --- lib/api.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3 From 358671ac1d55f8304b1c1aae285e497ed512ce0c Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Wed, 16 Jan 2013 20:29:29 +0000 Subject: Fix incorrect indentation --- lib/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/api.php b/lib/api.php index da0c2417dcf..e0097a7abf8 100644 --- a/lib/api.php +++ b/lib/api.php @@ -94,8 +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'); + header('WWW-Authenticate: Basic realm="Authorisation Required"'); + header('HTTP/1.0 401 Unauthorized'); $response = new OC_OCS_Result(null, 997, 'Unauthorised'); } // Send the response -- cgit v1.2.3 From b4954c0c89a39e82ccada459337392d4d38aba5c Mon Sep 17 00:00:00 2001 From: tomneedham Date: Thu, 17 Jan 2013 16:30:14 +0000 Subject: Correct spelling of 'Authorization' --- lib/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/api.php b/lib/api.php index e0097a7abf8..7d8f6878076 100644 --- a/lib/api.php +++ b/lib/api.php @@ -94,7 +94,7 @@ class OC_API { $response = new OC_OCS_Result(null, 998, 'Api method not found'); } } else { - header('WWW-Authenticate: Basic realm="Authorisation Required"'); + header('WWW-Authenticate: Basic realm="Authorization Required"'); header('HTTP/1.0 401 Unauthorized'); $response = new OC_OCS_Result(null, 997, 'Unauthorised'); } -- cgit v1.2.3