aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2015-01-14 12:37:58 +0530
committerVipul A M <vipulnsward@gmail.com>2015-01-14 12:37:58 +0530
commit822dc9133e59b253332e0f0cb76f873759615d06 (patch)
treec053f9359464d9bb9814a713c16509f3dc43be42
parent850159bd2c5e1e108d0256dd05424bbbf7926b59 (diff)
downloadrails-822dc9133e59b253332e0f0cb76f873759615d06.tar.gz
rails-822dc9133e59b253332e0f0cb76f873759615d06.tar.bz2
rails-822dc9133e59b253332e0f0cb76f873759615d06.zip
Extract `Date` header to string constant in Http Response, similar to other headers
-rw-r--r--actionpack/lib/action_dispatch/http/cache.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb
index 63a3cbc90b..747d295261 100644
--- a/actionpack/lib/action_dispatch/http/cache.rb
+++ b/actionpack/lib/action_dispatch/http/cache.rb
@@ -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