diff --git a/app/app.js b/app/app.js index 45e3ead290..0853f06c0f 100644 --- a/app/app.js +++ b/app/app.js @@ -1,5 +1,6 @@ const express = require('express') const app = express() +const bodyParser = require('body-parser') const nunjucks = require('nunjucks') const util = require('util') const fs = require('fs') @@ -60,6 +61,9 @@ module.exports = (options) => { app.use('/vendor/html5-shiv/', express.static('node_modules/html5shiv/dist/')) app.use('/assets', express.static(path.join(configPaths.src, 'assets'))) + // Turn form POSTs into data that can be used for validation. + app.use(bodyParser.urlencoded({ extended: true })) + // Handle the banner component serverside. require('./banner.js')(app) diff --git a/package-lock.json b/package-lock.json index 27d234240a..c89c8cf2eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -848,12 +848,6 @@ "requires": { "safer-buffer": "2.1.2" } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true } } }, diff --git a/package.json b/package.json index fc848eecbf..7685eef807 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "autoprefixer": "^9.3.1", + "body-parser": "^1.18.3", "cheerio": "^1.0.0-rc.2", "cookie-parser": "^1.4.4", "cssnano": "^4.1.7",