aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-02-19 02:04:26 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-02-19 02:04:26 +0000
commitbd0cd043744c0aca38273de82f8b77d0e62ac5f6 (patch)
tree5af1d57416d402c472c194e0a5d47015716da5ef /actionpack/lib/action_controller
parent372db1cd9e96dfe19217c2cc57b1406564dc16d8 (diff)
downloadrails-bd0cd043744c0aca38273de82f8b77d0e62ac5f6.tar.gz
rails-bd0cd043744c0aca38273de82f8b77d0e62ac5f6.tar.bz2
rails-bd0cd043744c0aca38273de82f8b77d0e62ac5f6.zip
Set cache-control to private if theres an etag available (and the cache-control hasnt been overwritten already)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rwxr-xr-xactionpack/lib/action_controller/response.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb
index b63b34c691..3a901cf351 100755
--- a/actionpack/lib/action_controller/response.rb
+++ b/actionpack/lib/action_controller/response.rb
@@ -45,7 +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']
+ self.headers['Cache-Control'] = 'private' if headers['Cache-Control'] == DEFAULT_HEADERS['Cache-Control']
if request.headers['HTTP_IF_NONE_MATCH'] == headers['Etag']
self.headers['Status'] = '304 Not Modified'