summary refs log tree commit
diff options
context:
space:
mode:
authorJames Tucker <jftucker@gmail.com>2014-11-27 15:59:26 -0800
committerJames Tucker <jftucker@gmail.com>2014-11-27 15:59:26 -0800
commit1e162b92625d3b0865a86cc50f346331d65d5a27 (patch)
tree147c11a6e2b3417356f6be8428f88768e985ea14
parent28e77c710ac2ddb35c436d78d72e28f28f964446 (diff)
parentf86c885ec5b4c95ac9736d09a4bbc70d3fe3f019 (diff)
downloadrack-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.rdoc28
-rw-r--r--lib/rack/utils.rb2
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