Skip to content

Commit

Permalink
Increase text/plain POST limit to 5 MB as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Dec 10, 2023
1 parent cf96d57 commit 59369c6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ app.use(function (ctx, next) {
return next();
});
app.use(cors);
app.use(bodyParser({ enableTypes: ['text', 'json'], jsonLimit: '5mb' }));
app.use(
bodyParser({
enableTypes: ['text', 'json'],
jsonLimit: '5mb',
textLimit: '5mb',
})
);
app.use(_.post('/web', WebEndpoint.handle.bind(WebEndpoint)));
app.use(_.post('/search', SearchEndpoint.handle.bind(SearchEndpoint)));
app.use(_.post('/export', ExportEndpoint.handle.bind(ExportEndpoint)));
Expand Down
8 changes: 7 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ app.use(function (ctx, next) {
return next();
});
app.use(cors);
app.use(bodyParser({ enableTypes: ['text', 'json'], jsonLimit: '5mb' }));
app.use(
bodyParser({
enableTypes: ['text', 'json'],
jsonLimit: '5mb',
textLimit: '5mb',
})
);
app.use(_.post('/web', WebEndpoint.handle.bind(WebEndpoint)));
app.use(_.post('/search', SearchEndpoint.handle.bind(SearchEndpoint)));
app.use(_.post('/export', ExportEndpoint.handle.bind(ExportEndpoint)));
Expand Down

0 comments on commit 59369c6

Please sign in to comment.