lib/rack/cache/response.rb in rtomayko-rack-cache-0.2.0 vs lib/rack/cache/response.rb in rtomayko-rack-cache-0.3.0
- old
+ new
@@ -32,11 +32,11 @@
# Create a Response instance given the response status code, header hash,
# and body.
def initialize(status, headers, body)
@status = status
- @headers = headers
+ @headers = Rack::Utils::HeaderHash.new(headers)
@body = body
@now = Time.now
@headers['Date'] ||= now.httpdate
end
@@ -60,10 +60,10 @@
headers['Age'] = age.to_i.to_s
end
# Return the status, headers, and body in a three-tuple.
def to_a
- [status, headers, body]
+ [status, headers.to_hash, body]
end
# Freezes
def freeze
@headers.freeze