diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-09-30 17:00:38 +0200 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-09-30 17:00:38 +0200 |
commit | 0eefa7058a47772978aef550f7d85235a5529874 (patch) | |
tree | f4cfe7d365a6baa23a67e8d3deeabd8ea08f45ec /actionpack/lib/action_controller | |
parent | 0b465032540ef92353e67eabd05eaf5867bfcc31 (diff) | |
download | rails-0eefa7058a47772978aef550f7d85235a5529874.tar.gz rails-0eefa7058a47772978aef550f7d85235a5529874.tar.bz2 rails-0eefa7058a47772978aef550f7d85235a5529874.zip |
Fix etag! and last_modified! to work as advertised.
Add tests too.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 457b9e85bc..0e8d3efca4 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -967,13 +967,15 @@ module ActionController #:nodoc: # Sets the Last-Modified response header. Returns 304 Not Modified if the # If-Modified-Since request header is <= last modified. def last_modified!(utc_time) - head(:not_modified) if response.last_modified!(utc_time) + response.last_modified= utc_time + head(:not_modified) if response.last_modified == request.if_modified_since end # Sets the ETag response header. Returns 304 Not Modified if the # If-None-Match request header matches. def etag!(etag) - head(:not_modified) if response.etag!(etag) + response.etag = etag + head(:not_modified) if response.etag == request.if_none_match end # Clears the rendered results, allowing for another render to be performed. |