aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-10-03 12:28:31 -0700
committerJosé Valim <jose.valim@gmail.com>2011-10-03 12:28:31 -0700
commit1eac9119620e9b537c1eca9619d4fa3ecb546149 (patch)
tree00b68433ca199593653405333bf926d7b4e4b2c9
parentc10fcd26376d9cdc4d4a27b66271ab33413ca18f (diff)
parentb05a56f47da24e57f1f1a398115cf664ec7eee56 (diff)
downloadrails-1eac9119620e9b537c1eca9619d4fa3ecb546149.tar.gz
rails-1eac9119620e9b537c1eca9619d4fa3ecb546149.tar.bz2
rails-1eac9119620e9b537c1eca9619d4fa3ecb546149.zip
Merge pull request #3202 from abscondment/3053-missing-headers
Use rack-cache 1.1
-rw-r--r--actionpack/actionpack.gemspec2
-rw-r--r--railties/test/application/middleware/cache_test.rb14
2 files changed, 15 insertions, 1 deletions
diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec
index f1b7966b9c..b208357584 100644
--- a/actionpack/actionpack.gemspec
+++ b/actionpack/actionpack.gemspec
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.add_dependency('activesupport', version)
s.add_dependency('activemodel', version)
- s.add_dependency('rack-cache', '~> 1.0.3')
+ s.add_dependency('rack-cache', '~> 1.1')
s.add_dependency('builder', '~> 3.0.0')
s.add_dependency('i18n', '~> 0.6')
s.add_dependency('rack', '~> 1.3.2')
diff --git a/railties/test/application/middleware/cache_test.rb b/railties/test/application/middleware/cache_test.rb
index e656ada3c0..050a2161ae 100644
--- a/railties/test/application/middleware/cache_test.rb
+++ b/railties/test/application/middleware/cache_test.rb
@@ -31,6 +31,10 @@ module ApplicationTests
$last_modified ||= Time.now.utc
render_conditionally(:last_modified => $last_modified)
end
+
+ def keeps_if_modified_since
+ render :text => request.headers['If-Modified-Since']
+ end
private
def render_conditionally(headers)
if stale?(headers.merge(:public => !params[:private]))
@@ -47,6 +51,16 @@ module ApplicationTests
RUBY
end
+ def test_cache_keeps_if_modified_since
+ simple_controller
+ expected = "Wed, 30 May 1984 19:43:31 GMT"
+
+ get "/expires/keeps_if_modified_since", {}, "HTTP_IF_MODIFIED_SINCE" => expected
+
+ assert_equal 200, last_response.status
+ assert_equal expected, last_response.body, "cache should have kept If-Modified-Since"
+ end
+
def test_cache_is_disabled_in_dev_mode
simple_controller
app("development")