Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
Subject: client_max_body_size param coming
Date: Fri, 30 Apr 2010 01:36:53 +0000	[thread overview]
Message-ID: <20100430013653.GA27483@dcvr.yhbt.net> (raw)

Hi all,

There are currently no limits to the size of an HTTP request body.

I'm leaning towards making the default limit 1 megabyte (same as nginx).
This means if you're currently running Rainbows! and processing large
uploads, upgrading to a future version will require you to configure
this parameter.

I'm adding this because it's possible for somebody with a high bandwidth
connection to run your server out of disk space.  This is because Rack
(unfortunately) requires request bodies to be rewindable.

This primarily affects the EventMachine, NeverBlock and Rev backends.
They buffer the entire request body before dispatching to the Rack app,
so there's no chance for middleware to intercept calls to "rack.input"
to avoid the flood.

The rest of the concurrency models that use TeeInput never actually read
request bodies off the socket until the data is needed (though
Rack::Request used by most apps will also read it for POST params),
so I'm thinking about introducing middleware to wrap TeeInput and
have it automatically added to the stack.

I don't like automatically throwing middleware into things, but
I think having consistent behavior for:

   Rainbows! do
     use :Foo
     client_max_body_size 10*1024*1024
   end

is important, as it only involves reconfiguring Rainbows!

Rainbows! will would return a "413 Request Entity Too Large" error in
cases when the body is too large and close the connection.

This will only affect Rainbows! and Zbatery.  I won't add this to
Unicorn since Unicorn was only designed to run behind nginx (and trusted
local clients).  Since Unicorn always uses TeeInput, anybody who really
wants it can add the new middleware to their stack.

Thanks for reading.

-- 
Eric Wong
_______________________________________________
Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
Do not quote signatures (like this one) or top post when replying


                 reply	other threads:[~2010-04-30  1:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100430013653.GA27483@dcvr.yhbt.net \
    --to=normalperson-rmlxzr9ms24@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).