about summary refs log tree commit homepage
path: root/lib/rainbows/http_server.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-06-11 06:35:12 +0000
committerEric Wong <normalperson@yhbt.net>2011-06-11 06:35:12 +0000
commit281ef555c40cf292809ad10d623d0571fafc790e (patch)
treee13fb2af08c6896b53f244bcf6efb36a9c730051 /lib/rainbows/http_server.rb
parent1f3e7b1c7ee89aefdcadd4aebd7b0527baa188a3 (diff)
downloadrainbows-281ef555c40cf292809ad10d623d0571fafc790e.tar.gz
Lowering this will lower worst-case memory usage and mitigate some
denial-of-service attacks.  This should be larger than
client_header_buffer_size.

The default value is carried over from Mongrel and Unicorn.
Diffstat (limited to 'lib/rainbows/http_server.rb')
-rw-r--r--lib/rainbows/http_server.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb
index be02630..746d534 100644
--- a/lib/rainbows/http_server.rb
+++ b/lib/rainbows/http_server.rb
@@ -97,4 +97,8 @@ class Rainbows::HttpServer < Unicorn::HttpServer
   def keepalive_requests
     Unicorn::HttpRequest.keepalive_requests
   end
+
+  def client_max_header_size=(bytes)
+    Unicorn::HttpParser.max_header_len = bytes
+  end
 end