From f307e37519ec86d78f60b743eaec09dbe4dd542e Mon Sep 17 00:00:00 2001 From: Jane Petrovna Date: Sun, 6 Jun 2021 02:08:07 -0400 Subject: [PATCH] this beef is fucking raw --- index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index fa2def7..a70855a 100644 --- a/index.js +++ b/index.js @@ -59,9 +59,7 @@ app.get("/indexes/:project(\\w+)", (req, res) => { } }); -app.use(express.json()); -// app.use(express.urlencoded()); -// app.use(express.text()); +app.use(express.raw()); function diff(current, checked) { let lines_current = current.split('\n').map(l => l.trim()).filter(l => l != ""); @@ -116,7 +114,7 @@ function diff(current, checked) { app.post("/updates/:project(\\w+)", (req, res) => { let project_id = req.params['project']; - const body = typeof req.body == "string" ? req.body : Object.keys(req.body)[0]; + const body = req.body || ""; console.log(req.body); console.log(`${req.body}, ${typeof req.body}`); console.log(`${body}`);