aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/response.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/response.rb')
-rw-r--r--actionpack/lib/action_controller/response.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb
index 559c38efd0..4c37f09215 100644
--- a/actionpack/lib/action_controller/response.rb
+++ b/actionpack/lib/action_controller/response.rb
@@ -115,7 +115,11 @@ module ActionController # :nodoc:
end
def etag=(etag)
- headers['ETag'] = %("#{Digest::MD5.hexdigest(ActiveSupport::Cache.expand_cache_key(etag))}")
+ if etag.blank?
+ headers.delete('ETag')
+ else
+ headers['ETag'] = %("#{Digest::MD5.hexdigest(ActiveSupport::Cache.expand_cache_key(etag))}")
+ end
end
def redirect(url, status)