[erlang-questions] Cowboy/giallo {error,badlength}

Bip Thelin bip@REDACTED
Wed May 15 10:01:48 CEST 2013


Comments interspersed.
> I have a very small and very stupid question about Cowboy (or, perhaps, giallo? )
That would be giallo.

> giallo:post_param(<<"param_name">>, Req)  returns {error, badlength} for rather short texts (I really need to post much larger texts).

> How can I raise the limit on the body length?
You've hit the default MaxBodyLength of 16kb: https://github.com/extend/cowboy/blob/master/guide/req.md#request-body

I've just pushed a new version with a post_param/4 which lets you optionally specify your own MaxBodyLength or the atom infinity to ignore the body_length check. Remember that the body_length check was added to cowboy to mitigate a possible DoS scenario: https://gist.github.com/josevalim/eea34c1c76056d2fdf4f

--
Bip Thelin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130515/2fe179de/attachment.htm>


More information about the erlang-questions mailing list