From 2d2071b0fba26015043ea7667d033bb480978c0d Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 1 Jun 2020 22:21:45 -0400 Subject: [PATCH] fix /data paths --- app.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 10359bf3..2cc62a47 100644 --- a/app.js +++ b/app.js @@ -426,7 +426,7 @@ function handleData(req, res, next) { addCorsHeaders(req, res); 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'], space = tok[2] || null, version = tok[3], @@ -474,11 +474,7 @@ function handleData(req, res, next) { } else { db.get(countKey(space)).then(version => retrieve(version)); } - - return; - } else if (valid && req.method === 'POST') { - let dbOwner = null, dbVersion = null, postBody = null, @@ -528,8 +524,8 @@ function handleData(req, res, next) { dbVersion = parseInt(version || "0") + 1; checkDone(); }); - - return; + } else { + next(); } }