From 63c32b35cccd5f2358565f828db240200e8bffa7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 7 Jan 2011 15:47:33 -0800 Subject: more consistent use/avoidance of HeaderHash Rack::Utils::HeaderHash is still expensive, so avoid forcing it on users since we can assume app/library authors use normally-cased HTTP headers. --- lib/rainbows/sendfile.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/rainbows/sendfile.rb') diff --git a/lib/rainbows/sendfile.rb b/lib/rainbows/sendfile.rb index 2804217..545b85c 100644 --- a/lib/rainbows/sendfile.rb +++ b/lib/rainbows/sendfile.rb @@ -72,13 +72,12 @@ class Rainbows::Sendfile < Struct.new(:app) end # :stopdoc: - HH = Rack::Utils::HeaderHash X_SENDFILE = 'X-Sendfile' # :startdoc: def call(env) # :nodoc: status, headers, body = app.call(env) - headers = HH.new(headers) + headers = Rack::Utils::HeaderHash.new(headers) unless Hash === headers if path = headers.delete(X_SENDFILE) body = Body.new(path, headers) unless body.respond_to?(:to_path) end -- cgit v1.2.3-24-ge0c7