From 8ad4fb3a807de5e4b368a1f723be7b21a09f0e96 Mon Sep 17 00:00:00 2001 From: Jane Petrovna Date: Sun, 6 Jun 2021 02:12:31 -0400 Subject: [PATCH] i --- index.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 5b44ab3..2256d63 100644 --- a/index.js +++ b/index.js @@ -20,17 +20,6 @@ if (log_disabled) { app.use("/files", express.static("projects")); -app.use(function myMiddleware(req, res, next) { - req.rawBody = ''; - - req.on('data', function (chunk) { - req.rawBody += chunk; - }); - - // call next() outside of 'end' after setting 'data' handler - next(); -}); - function get_indexes(project_id) { if (cache[project_id]) { let indexes = ""; @@ -69,8 +58,11 @@ app.get("/indexes/:project(\\w+)", (req, res) => { res.sendStatus(404); } }); - -app.use(express.raw()); +app.use((req, res, next) => { + console.log(req); + next(); +}) +app.use(express.urlencoded({ extended: false })); function diff(current, checked) { let lines_current = current.split('\n').map(l => l.trim()).filter(l => l != "");