This commit is contained in:
jane 2021-06-06 02:12:31 -04:00
parent 883655717f
commit 8ad4fb3a80

View file

@ -20,17 +20,6 @@ if (log_disabled) {
app.use("/files", express.static("projects")); 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) { function get_indexes(project_id) {
if (cache[project_id]) { if (cache[project_id]) {
let indexes = ""; let indexes = "";
@ -69,8 +58,11 @@ app.get("/indexes/:project(\\w+)", (req, res) => {
res.sendStatus(404); res.sendStatus(404);
} }
}); });
app.use((req, res, next) => {
app.use(express.raw()); console.log(req);
next();
})
app.use(express.urlencoded({ extended: false }));
function diff(current, checked) { function diff(current, checked) {
let lines_current = current.split('\n').map(l => l.trim()).filter(l => l != ""); let lines_current = current.split('\n').map(l => l.trim()).filter(l => l != "");