Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Add config options for json and urlencoded limits in express bodyParser #1941

Closed
reesesm2000 opened this issue Mar 20, 2020 · 1 comment
Closed
Milestone

Comments

@reesesm2000
Copy link

reesesm2000 commented Mar 20, 2020

Need to have the ability to configure the limits for the json and urlencoded in the Express bodyParser.

Changes needed in core.js as follows
Line 101 from
this._config = Object.assign({ webhook_uri: '/api/messages', dialogStateProperty: 'dialogState', disable_webserver: false }, config);
to
this._config = Object.assign({ webhook_uri: '/api/messages', dialogStateProperty: 'dialogState', disable_webserver: false, jsonLimit: '100kb', urlencodedLimit: '100kb' }, config);

Lines 138 and 139 from
this.webserver.use(bodyParser.json());
this.webserver.use(bodyParser.urlencoded({ extended: true }));
to
this.webserver.use(bodyParser.json({limit: this._config.jsonLimit, extended: true}));
this.webserver.use(bodyParser.urlencoded({limit: this._config.urlencodedLimit, extended: true }));

  • Botkit version: 4.8.1
  • Messaging Platform: Slack
  • Node version: LTR
  • Os: CentOS
  • Any other relevant information:
@reesesm2000 reesesm2000 reopened this Mar 20, 2020
@benbrown benbrown added this to the 4.9 milestone Mar 23, 2020
benbrown added a commit that referenced this issue May 20, 2020
@benbrown
Copy link
Contributor

fixed in 4.9

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants