diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-10-06 13:15:39 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-10-06 13:39:03 -0700 |
commit | cddb700cc2d8d82ebc96162b48df85aed7106df1 (patch) | |
tree | cf53693422fe6bd392a9e93306dd7377944b7c84 | |
parent | 71317e6406dba9a552760ec035b67b3c16162528 (diff) | |
download | rails-cddb700cc2d8d82ebc96162b48df85aed7106df1.tar.gz rails-cddb700cc2d8d82ebc96162b48df85aed7106df1.tar.bz2 rails-cddb700cc2d8d82ebc96162b48df85aed7106df1.zip |
etag header is in Rack, so use it's response methods
Rack implements the Etag header manipulation methods, so we can use
those instead of ours.
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/cache.rb | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 0bc307cf1e..81ea2d1846 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,7 +29,7 @@ GIT GIT remote: git://github.com/rack/rack.git - revision: c617ea99c12a5bfe026e00476ff37e714e01891a + revision: e2a8388d59bbad0cb867150185770ad76e80d31a branch: master specs: rack (2.0.0.alpha) diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb index 6b25ee9a70..f72a2607b6 100644 --- a/actionpack/lib/action_dispatch/http/cache.rb +++ b/actionpack/lib/action_dispatch/http/cache.rb @@ -82,19 +82,15 @@ module ActionDispatch def etag=(etag) key = ActiveSupport::Cache.expand_cache_key(etag) - set_header ETAG, %("#{Digest::MD5.hexdigest(key)}") + super %("#{Digest::MD5.hexdigest(key)}") end - def etag - get_header ETAG - end - alias :etag? :etag + def etag?; etag; end private DATE = 'Date'.freeze LAST_MODIFIED = "Last-Modified".freeze - ETAG = "ETag".freeze CACHE_CONTROL = "Cache-Control".freeze SPECIAL_KEYS = Set.new(%w[extras no-cache max-age public must-revalidate]) |