Permalink
Browse files

Its ETag not Etag

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent bd0cd04 commit 94fa0ed053a92b4dc48501d7dc7e7ebcec7e1ca6 @dhh dhh committed Feb 19, 2007
Showing with 8 additions and 8 deletions.
  1. +2 −2 actionpack/lib/action_controller/response.rb
  2. +6 −6 actionpack/test/controller/render_test.rb
@@ -44,10 +44,10 @@ def prepare!
private
def handle_conditional_get!
if body.is_a?(String) && headers['Status'][0..2] == '200' && !body.empty?
- self.headers['Etag'] ||= %("#{Digest::MD5.hexdigest(body)}")
+ self.headers['ETag'] ||= %("#{Digest::MD5.hexdigest(body)}")
self.headers['Cache-Control'] = 'private' if headers['Cache-Control'] == DEFAULT_HEADERS['Cache-Control']
- if request.headers['HTTP_IF_NONE_MATCH'] == headers['Etag']
+ if request.headers['HTTP_IF_NONE_MATCH'] == headers['ETag']
self.headers['Status'] = '304 Not Modified'
self.body = ''
end
@@ -292,7 +292,7 @@ def test_accessing_local_assigns_in_inline_template_with_string_keys
def test_render_200_should_set_etag
get :render_hello_world_from_variable
- assert_equal etag_for("hello david"), @response.headers['Etag']
+ assert_equal etag_for("hello david"), @response.headers['ETag']
end
def test_render_against_etag_request_should_304_when_match
@@ -312,7 +312,7 @@ def test_render_against_etag_request_should_200_when_no_match
def test_render_with_etag
get :render_hello_world_from_variable
expected_etag = etag_for('hello david')
- assert_equal expected_etag, @response.headers['Etag']
+ assert_equal expected_etag, @response.headers['ETag']
@request.headers["HTTP_IF_NONE_MATCH"] = expected_etag
get :render_hello_world_from_variable
@@ -325,20 +325,20 @@ def test_render_with_etag
def render_with_404_shouldnt_have_etag
get :render_custom_code
- assert_nil @response.headers['Etag']
+ assert_nil @response.headers['ETag']
end
def test_etag_should_not_be_changed_when_already_set
expected_etag = etag_for("hello somewhere else")
- @response.headers["Etag"] = expected_etag
+ @response.headers["ETag"] = expected_etag
get :render_hello_world_from_variable
- assert_equal expected_etag, @response.headers['Etag']
+ assert_equal expected_etag, @response.headers['ETag']
end
def test_etag_should_govern_renders_with_layouts_too
get :builder_layout_test
assert_equal "<wrapper>\n<html>\n <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n", @response.body
- assert_equal etag_for("<wrapper>\n<html>\n <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n"), @response.headers['Etag']
+ assert_equal etag_for("<wrapper>\n<html>\n <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n"), @response.headers['ETag']
end

0 comments on commit 94fa0ed

Please sign in to comment.