Returns 401 Unauthorized for queries without permission
This commit is contained in:
parent
0500d21fd5
commit
2d232c20ef
3
NEWS.md
3
NEWS.md
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user