about summary refs log tree commit homepage
path: root/lib/rainbows/response.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-05 10:56:50 -0800
committerEric Wong <normalperson@yhbt.net>2011-01-05 10:59:35 -0800
commite8ae2e483e75ad163212cc8d3a7107eb2a014a9c (patch)
treee6fde00c498f95f1db199bd54c5a8ad18b28e15b /lib/rainbows/response.rb
parent16b24c86cecec0697b35ac321cddd500bc9cfdea (diff)
downloadrainbows-e8ae2e483e75ad163212cc8d3a7107eb2a014a9c.tar.gz
HeaderHash is quite expensive, and Rack::File currently
uses a regular Ruby Hash with properly-cased headers the
same way they're presented in rfc2616.
Diffstat (limited to 'lib/rainbows/response.rb')
-rw-r--r--lib/rainbows/response.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rainbows/response.rb b/lib/rainbows/response.rb
index 705de62..b624ea2 100644
--- a/lib/rainbows/response.rb
+++ b/lib/rainbows/response.rb
@@ -124,7 +124,10 @@ module Rainbows::Response
         return
       a, b = $1.split(/-/)
 
-      headers = Rack::Utils::HeaderHash.new(headers)
+      # HeaderHash is quite expensive, and Rack::File currently
+      # uses a regular Ruby Hash with properly-cased headers the
+      # same way they're presented in rfc2616.
+      headers = Rack::Utils::HeaderHash.new(headers) unless Hash === headers
       clen = headers[Content_Length] or return
       size = clen.to_i