fix /data paths
This commit is contained in:
parent
c5f397dfdd
commit
2d2071b0fb
1 changed files with 3 additions and 7 deletions
10
app.js
10
app.js
|
|
@ -426,7 +426,7 @@ function handleData(req, res, next) {
|
||||||
addCorsHeaders(req, res);
|
addCorsHeaders(req, res);
|
||||||
res.setHeader('Cache-Control', 'private, no-cache, max-age=0');
|
res.setHeader('Cache-Control', 'private, no-cache, max-age=0');
|
||||||
|
|
||||||
let tok = req.app.url.path.split('/'),
|
let tok = req.app.path.split('/'),
|
||||||
muid = req.headers['x-moto-ajax'],
|
muid = req.headers['x-moto-ajax'],
|
||||||
space = tok[2] || null,
|
space = tok[2] || null,
|
||||||
version = tok[3],
|
version = tok[3],
|
||||||
|
|
@ -474,11 +474,7 @@ function handleData(req, res, next) {
|
||||||
} else {
|
} else {
|
||||||
db.get(countKey(space)).then(version => retrieve(version));
|
db.get(countKey(space)).then(version => retrieve(version));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
} else if (valid && req.method === 'POST') {
|
} else if (valid && req.method === 'POST') {
|
||||||
|
|
||||||
let dbOwner = null,
|
let dbOwner = null,
|
||||||
dbVersion = null,
|
dbVersion = null,
|
||||||
postBody = null,
|
postBody = null,
|
||||||
|
|
@ -528,8 +524,8 @@ function handleData(req, res, next) {
|
||||||
dbVersion = parseInt(version || "0") + 1;
|
dbVersion = parseInt(version || "0") + 1;
|
||||||
checkDone();
|
checkDone();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
return;
|
next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue