Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set cache-control to private if theres an etag available (and the cac…

…he-control hasnt been overwritten already)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit bd0cd043744c0aca38273de82f8b77d0e62ac5f6 1 parent 372db1c
@dhh dhh authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_controller/response.rb
View
2  actionpack/lib/action_controller/response.rb
@@ -45,7 +45,7 @@ def prepare!
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'
Please sign in to comment.
Something went wrong with that request. Please try again.