Use modified body-parser accepting YAML

This commit is contained in:
D. Berge
2023-08-23 19:11:20 +02:00
parent 8f8e8b7492
commit 33edef6647
3 changed files with 721 additions and 377 deletions

View File

@@ -1,6 +1,7 @@
const http = require('http');
const express = require('express');
express.yaml ??= require('body-parser').yaml; // NOTE: Use own customised body-parser
const cookieParser = require('cookie-parser')
const maybeSendAlert = require("../lib/alerts");
@@ -31,6 +32,7 @@ app.map = function(a, route){
};
app.use(express.json({type: "application/json", strict: false, limit: '10mb'}));
app.use(express.yaml({type: "application/yaml", limit: '10mb'}));
app.use(express.urlencoded({ type: "application/x-www-form-urlencoded", extended: true }));
app.use(express.text({type: "text/*", limit: '10mb'}));
app.use((req, res, next) => {

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,7 @@
"linux"
],
"dependencies": {
"body-parser": "gitlab:aaltronav/contrib/expressjs/body-parser",
"cookie-parser": "^1.4.5",
"debug": "^4.3.4",
"express": "^4.17.1",