From 372db1cd9e96dfe19217c2cc57b1406564dc16d8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 19 Feb 2007 01:33:35 +0000 Subject: 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 --- actionpack/lib/action_controller/response.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_controller/response.rb') 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' -- cgit v1.2.3