Returns 401 Unauthorized for queries without permission

This commit is contained in:
Raul Ochoa 2014-09-02 15:00:04 +02:00
parent 0500d21fd5
commit 2d232c20ef
2 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,9 @@
1.16.1 - 2014-mm-dd
-------------------
Bug fixes:
* Returns 401 Unauthorized for queries without permission
New features:
* New header for database host serving the request

View File

@ -590,6 +590,10 @@ function handleException(err, res){
function getStatusError(err, req) {
var statusError = _.isUndefined(err.http_status) ? 400 : err.http_status;
if (err.message && err.message.match(/permission denied/)) {
statusError = 401;
}
// JSONP has to return 200 status error
if (req && req.query && req.query.callback) {
statusError = 200;