[Catalyst] Large requests with JSON?

Bill Moseley moseley at hank.org
Fri Feb 5 20:54:40 GMT 2010


As you might have picked up I'm working on an REST api that uses JSON in the
request.  I need to also allow large file uploads.

HTTP::Body::OctetStream will chunk the request body and send to a temp file,
but Catalyst::Action::Deserialize::JSON will load the temp file into memory.
 Obviously, want to limit that.

AFAIK, there's no way to stream parse JSON (so that only part is in memory
at any given time).  What would be the recommended serialization for
uploaded files -- just use multipart/form-data for the uploads?

BTW -- I don't see any code in HTTP::Body to limit body size.  Doesn't that
seem like a pretty easy DoS for Catalyst apps?  I do set a request size
limit in the web server, but if I need to allow 1/2GB uploads or so then
could kill the machine pretty easily, no?



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100205/d6b04=
540/attachment.htm


More information about the Catalyst mailing list