Skip to content

Commit

Permalink
ACRS-211-Bugfix For over 1500 characters
Browse files Browse the repository at this point in the history
-  I have added this changes to HOF framework version :
 21.0.1 and 20.5.7-Beta-payload-too-large.

-  Added two variable in the config.js to allow a dynamic body parser size be increased by developer.
  • Loading branch information
TemitopeAyokuHO committed Jul 24, 2024
1 parent a28a30c commit ce01fec
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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();
});

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
[email protected].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"
Expand Down

0 comments on commit ce01fec

Please sign in to comment.