1
0
Fork 0

simplifications

This commit is contained in:
Jan Steemann 2016-05-19 17:23:01 +02:00
parent e03cff939b
commit 70d60e623e
2 changed files with 2 additions and 8 deletions

View File

@ -38,12 +38,7 @@ var cluster = require("@arangodb/cluster");
////////////////////////////////////////////////////////////////////////////////
function databasePrefix (req, url) {
if (req.hasOwnProperty('compatibility') && req.compatibility < 10400) {
// pre 1.4-style location response (e.g. /_api/collection/xyz)
return url;
}
// 1.4-style location response (e.g. /_db/dbname/_api/collection/xyz)
// location response (e.g. /_db/dbname/_api/collection/xyz)
return "/_db/" + encodeURIComponent(arangodb.db._name()) + url;
}

View File

@ -162,8 +162,7 @@ function post_api_database (req, res) {
var result = arangodb.db._createDatabase(json.name || "", options, users);
var returnCode = (req.compatibility <= 10400 ? actions.HTTP_OK : actions.HTTP_CREATED);
actions.resultOk(req, res, returnCode, { result : result });
actions.resultOk(req, res, actions.HTTP_CREATED, { result : result });
}
////////////////////////////////////////////////////////////////////////////////