node-restify icon indicating copy to clipboard operation
node-restify copied to clipboard

Keep getting the error "request entity too large (413)"

Open puneeth8994 opened this issue 9 years ago • 2 comments

Does restify have an option to specify the max body size? I keep getting the error "request entity too large".

I'm using restify's version 4.3.0

Neither of the following parsers seem to be working - server.use(restify.plugins.acceptParser(server.acceptable)); server.use(restify.plugins.authorizationParser()); server.use(restify.plugins.dateParser()); server.use(restify.plugins.queryParser()); server.use(restify.plugins.jsonp()); server.use(restify.plugins.gzipResponse()); server.use(restify.plugins.bodyParser()); //server.use(restify.plugins.requestExpiry()); server.use(restify.plugins.throttle({ burst: 100, rate: 50, ip: true, overrides: { '192.168.1.1': { rate: 0, // unlimited burst: 0 } } })); server.use(restify.plugins.conditionalRequest());

and

server.use(restify.bodyParser()) server.use(restify.jsonBodyParser({ mapParams: true })) server.use(restify.urlEncodedBodyParser()) server.use(restify.bodyParser()); server.use(restify.acceptParser(server.acceptable)) server.use(restify.queryParser({ mapParams: true })) server.use(restify.fullResponse())

puneeth8994 avatar Nov 30 '17 18:11 puneeth8994

@puneeth8994 You can use maxBodySize with your bodyParser plugin.

Example:

server.use(restify.plugins.bodyParser({
       maxBodySize: 1024
}));

rajatkumar avatar Nov 30 '17 19:11 rajatkumar

@puneeth8994 let us know if that resolved your issue - feel free to reopen if that's the case.

DonutEspresso avatar Dec 14 '17 02:12 DonutEspresso