diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rainbows/dev_fd_response.rb | 2 | ||||
-rw-r--r-- | lib/rainbows/ev_core.rb | 2 | ||||
-rw-r--r-- | lib/rainbows/sendfile.rb | 3 | ||||
-rw-r--r-- | lib/rainbows/server_token.rb | 2 |
4 files changed, 4 insertions, 5 deletions
diff --git a/lib/rainbows/dev_fd_response.rb b/lib/rainbows/dev_fd_response.rb index 60b595e..17081e3 100644 --- a/lib/rainbows/dev_fd_response.rb +++ b/lib/rainbows/dev_fd_response.rb @@ -39,7 +39,7 @@ class Rainbows::DevFdResponse < Struct.new(:app) io ||= File.open(body.to_path) if body.respond_to?(:to_path) return response if io.nil? - headers = HeaderHash.new(headers) + headers = Rack::Utils::HeaderHash.new(headers) unless Hash === headers st = io.stat fileno = io.fileno FD_MAP[fileno] = io diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb index 66d177f..448338f 100644 --- a/lib/rainbows/ev_core.rb +++ b/lib/rainbows/ev_core.rb @@ -49,7 +49,7 @@ module Rainbows::EvCore # returns whether to enable response chunking for autochunk models def stream_response_headers(status, headers, alive) - headers = Rack::Utils::HeaderHash.new(headers) + headers = Rack::Utils::HeaderHash.new(headers) unless Hash === headers if headers.include?(Content_Length) rv = false else 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 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 |