diff --git a/config.js b/config.js index 7a59487..0117a2c 100644 --- a/config.js +++ b/config.js @@ -88,5 +88,7 @@ module.exports = { uniqueReferralRefs: { refLength: 6, refAllowedChars: 'ABCDEFGHJKMNPRTUVWXY0123456789' - } + }, + urlEncodedLimitSize : process.env.URL_ENCODED_LIMIT_SIZE || '2mb', + jsonLimitSize : process.env.JSON_LIMIT_SIZE || '2mb' }; diff --git a/package.json b/package.json index 0b6b682..71a396a 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "bytes": "^3.1.2", "crypto-random-string": "^5.0.0", "dotenv": "^16.3.1", - "hof": "~20.5.0", + "hof": "20.5.7-Beta-payload-too-large", "ioredis": "^5.4.1", "jquery": "^3.7.1", "lodash": "^4.17.21", diff --git a/server.js b/server.js index fc2102c..3aec11b 100644 --- a/server.js +++ b/server.js @@ -7,14 +7,15 @@ const _ = require('lodash'); const busboy = require('busboy'); const bl = require('bl'); const logger = require('hof/lib/logger')({ env: config.env }); - +const bodyParser = require('body-parser'); let settings = require('./hof.settings'); settings = Object.assign({}, settings, { routes: settings.routes.map(require), - behaviours: settings.behaviours.map(require) + behaviours: settings.behaviours.map(require), }); + if (!fs.existsSync(config.dataDirectory)) { fs.mkdirSync(config.dataDirectory); } @@ -26,7 +27,7 @@ app.use((req, res, next) => { const protocol = host.includes('localhost') ? 'http' : 'https'; res.locals.formUrl = `${protocol}://${host}`; res.locals.htmlLang = 'en'; - + next(); }); diff --git a/yarn.lock b/yarn.lock index 06b1cdf..6124a73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3121,10 +3121,10 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hof@~20.5.0: - version "20.5.2" - resolved "https://registry.yarnpkg.com/hof/-/hof-20.5.2.tgz#1a7a5660fd8a92991903619b18fca5c7e624201c" - integrity sha512-TdENaThMn36S6J2vpjRoujAEtJuDKmkwUEfuqVyXZFOqboFN1/nuC9NnYimKkcxvMxq61rWQDsmwNgO/wQN6cQ== +hof@20.5.7-Beta-payload-too-large: + version "20.5.7-Beta-payload-too-large" + resolved "https://registry.yarnpkg.com/hof/-/hof-20.5.7-Beta-payload-too-large.tgz#b04fb9ee3449eafad622a51668aa1eae174cdc58" + integrity sha512-9kFekPljshg5UpY0TUu80hsikWCM2ffl57NhNNZMpPaNSXapHnhl+TK3Lr7lDqJPWWLE14cewl5ICkP+thV8Lg== dependencies: aliasify "^2.1.0" bluebird "^3.7.2"