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 != "");