diff options
author | James Tucker <jftucker@gmail.com> | 2014-11-27 15:59:26 -0800 |
---|---|---|
committer | James Tucker <jftucker@gmail.com> | 2014-11-27 15:59:26 -0800 |
commit | 1e162b92625d3b0865a86cc50f346331d65d5a27 (patch) | |
tree | 147c11a6e2b3417356f6be8428f88768e985ea14 | |
parent | 28e77c710ac2ddb35c436d78d72e28f28f964446 (diff) | |
parent | f86c885ec5b4c95ac9736d09a4bbc70d3fe3f019 (diff) | |
download | rack-1e162b92625d3b0865a86cc50f346331d65d5a27.tar.gz |
Merge pull request #763 from byroot/multipart-limit-doc
Document the multipart_part_limit configuration in the README
-rw-r--r-- | README.rdoc | 28 | ||||
-rw-r--r-- | lib/rack/utils.rb | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/README.rdoc b/README.rdoc index d5bd6d2e..6799448c 100644 --- a/README.rdoc +++ b/README.rdoc @@ -181,6 +181,34 @@ Installing the Ruby fcgi gem: Furthermore, to test Memcache sessions, you need memcached (will be run on port 11211) and memcache-client installed. +== Configuration + +Several parameters can be modified on `Rack::Utils` to configure Rack behaviour. + +e.g: + +```ruby +Rack::Utils.key_space_limit = 128 +``` + +=== key_space_limit + +The default number of bytes to allow a single parameter key to take up. +This helps prevent a rogue client from flooding a Request. + +Default to 65536 characters (4 kiB in worst case). + +=== multipart_part_limit + +The maximum number of parts a request can contain. +Accepting too many part can lead to the server running out of file handles. + +The default is `128`, which mean that a single request can't upload more than 128 files at once. + +Set to `0` for not limit. + +Can also be set via the `RACK_MULTIPART_PART_LIMIT` environment variable. + == History * March 3rd, 2007: First public release 0.1. diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb index 586bd6e4..81a76081 100644 --- a/lib/rack/utils.rb +++ b/lib/rack/utils.rb @@ -68,7 +68,7 @@ module Rack # This helps prevent a rogue client from flooding a Request. self.key_space_limit = 65536 - # The maximum number of parts a request can contain. Accepting to many part + # The maximum number of parts a request can contain. Accepting too many part # can lead to the server running out of file handles. # Set to `0` for no limit. self.multipart_part_limit = (ENV['RACK_MULTIPART_LIMIT'] || 128).to_i |