From: Thomas Müller Date: Fri, 18 Jan 2013 13:52:51 +0000 (-0800) Subject: Merge pull request #1205 from owncloud/ocs_api X-Git-Tag: v5.0.0alpha1~225 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0ed635240a56cc16596be39af7d71bdcd276425b;p=nextcloud-server.git Merge pull request #1205 from owncloud/ocs_api Return 401 headers when trying to access a restricted api call --- 0ed635240a56cc16596be39af7d71bdcd276425b diff --cc lib/api.php index 8d728d4311f,7d8f6878076..0fce109a423 --- a/lib/api.php +++ b/lib/api.php @@@ -92,8 -92,10 +92,10 @@@ class OC_API $response = call_user_func(self::$actions[$name]['action'], $parameters); } else { $response = new OC_OCS_Result(null, 998, 'Api method not found'); - } + } } else { + header('WWW-Authenticate: Basic realm="Authorization Required"'); + header('HTTP/1.0 401 Unauthorized'); $response = new OC_OCS_Result(null, 997, 'Unauthorised'); } // Send the response