aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/response.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-02-19 01:33:35 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-02-19 01:33:35 +0000
commit372db1cd9e96dfe19217c2cc57b1406564dc16d8 (patch)
tree405d4497c59693d2ecb73ec22795ecbd0b9b1193 /actionpack/lib/action_controller/response.rb
parent7ec0204ecd7557a63267ff64cc412338176a0805 (diff)
downloadrails-372db1cd9e96dfe19217c2cc57b1406564dc16d8.tar.gz
rails-372db1cd9e96dfe19217c2cc57b1406564dc16d8.tar.bz2
rails-372db1cd9e96dfe19217c2cc57b1406564dc16d8.zip
Dont ask for no caching if we have a etag to base that decision on
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/response.rb')
-rwxr-xr-xactionpack/lib/action_controller/response.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb
index 8c4aec8d61..b63b34c691 100755
--- a/actionpack/lib/action_controller/response.rb
+++ b/actionpack/lib/action_controller/response.rb
@@ -45,6 +45,7 @@ module ActionController
def handle_conditional_get!
if body.is_a?(String) && headers['Status'][0..2] == '200' && !body.empty?
self.headers['Etag'] ||= %("#{Digest::MD5.hexdigest(body)}")
+ headers.delete('Cache-Control') if headers['Cache-Control'] == DEFAULT_HEADERS['Cache-Control']
if request.headers['HTTP_IF_NONE_MATCH'] == headers['Etag']
self.headers['Status'] = '304 Not Modified'