about summary refs log tree commit homepage
path: root/lib/rainbows/server_token.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-07 15:47:33 -0800
committerEric Wong <normalperson@yhbt.net>2011-01-07 15:47:33 -0800
commit63c32b35cccd5f2358565f828db240200e8bffa7 (patch)
tree67344a5eac4d82aab6c2cdd6ec093bf77c31733d /lib/rainbows/server_token.rb
parent58dbf0952b94b01d4a434fa880755f9a320c6103 (diff)
downloadrainbows-63c32b35cccd5f2358565f828db240200e8bffa7.tar.gz
Rack::Utils::HeaderHash is still expensive, so avoid
forcing it on users since we can assume app/library
authors use normally-cased HTTP headers.
Diffstat (limited to 'lib/rainbows/server_token.rb')
-rw-r--r--lib/rainbows/server_token.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/server_token.rb b/lib/rainbows/server_token.rb
index 4098ca7..0ee87ac 100644
--- a/lib/rainbows/server_token.rb
+++ b/lib/rainbows/server_token.rb
@@ -30,7 +30,7 @@ class ServerToken < Struct.new(:app, :token)
 
   def call(env)
     status, headers, body = app.call(env)
-    headers = Rack::Utils::HeaderHash.new(headers)
+    headers = Rack::Utils::HeaderHash.new(headers) unless Hash === headers
     headers[SERVER] = token
     [ status, headers, body ]
   end