diff --git a/src/dockerproxy.js b/src/dockerproxy.js index b7a46c3e0..f70db6e6c 100644 --- a/src/dockerproxy.js +++ b/src/dockerproxy.js @@ -118,7 +118,7 @@ function process(req, res, next) { async function start() { assert(gHttpServer === null, 'Already started'); - const json = middleware.json({ strict: true }); + const json = express.json({ strict: true }); // we protect container create as the app/admin can otherwise mount random paths (like the ghost file) // protected other paths is done by preventing install/exec access of apps using docker addon diff --git a/src/middleware/index.js b/src/middleware/index.js index 2b3f80ee9..72b0dd6ce 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -3,7 +3,6 @@ exports = module.exports = { cookieParser: require('cookie-parser'), cors: require('./cors.js'), - json: require('body-parser').json, proxy: require('./proxy-middleware.js'), lastMile: require('connect-lastmile'), multipart: require('./multipart.js'), diff --git a/src/oidc.js b/src/oidc.js index d80968b85..4eb024048 100644 --- a/src/oidc.js +++ b/src/oidc.js @@ -888,7 +888,7 @@ async function start() { app.set('views', path.join(__dirname, 'oidc_templates')); app.set('view engine', 'ejs'); - const json = middleware.json({ strict: true, limit: '2mb' }); + const json = express.json({ strict: true, limit: '2mb' }); function setNoCache(req, res, next) { res.set('cache-control', 'no-store'); next(); diff --git a/src/server.js b/src/server.js index be0998f1a..b85e1830c 100644 --- a/src/server.js +++ b/src/server.js @@ -41,7 +41,7 @@ async function initializeExpressSync() { const REQUEST_TIMEOUT = 60000; // timeout for all requests (see also setTimeout on the httpServer) - const json = middleware.json({ strict: true, limit: QUERY_LIMIT }), // application/json + const json = express.json({ strict: true, limit: QUERY_LIMIT }), // application/json urlencoded = middleware.urlencoded({ extended: false, limit: QUERY_LIMIT }); // application/x-www-form-urlencoded app.set('json spaces', 2); // pretty json