Extract `Date` header to string constant in Http Response, similar to other headers

This commit is contained in:
Vipul A M 2015-01-14 12:37:58 +05:30
parent 850159bd2c
commit 822dc9133e
1 changed files with 4 additions and 3 deletions

View File

@ -69,17 +69,17 @@ module ActionDispatch
end
def date
if date_header = headers['Date']
if date_header = headers[DATE]
Time.httpdate(date_header)
end
end
def date?
headers.include?('Date')
headers.include?(DATE)
end
def date=(utc_time)
headers['Date'] = utc_time.httpdate
headers[DATE] = utc_time.httpdate
end
def etag=(etag)
@ -89,6 +89,7 @@ module ActionDispatch
private
DATE = 'Date'.freeze
LAST_MODIFIED = "Last-Modified".freeze
ETAG = "ETag".freeze
CACHE_CONTROL = "Cache-Control".freeze