Skip to content
Browse files

No cache for chunked responses

  • Loading branch information...
1 parent 356a20c commit 0511fd601b3072e313dc4e3eee5440747d8f3690 @lifo committed Aug 13, 2011
Showing with 4 additions and 0 deletions.
  1. +1 −0 lib/cramp/action.rb
  2. +3 −0 test/controller/chunked_transport_test.rb
View
1 lib/cramp/action.rb
@@ -39,6 +39,7 @@ def build_headers
when :chunked
status, headers = respond_to?(:respond_with, true) ? respond_with : [200, {}]
headers['Content-Type'] ||= 'text/html'
+ headers['Cache-Control'] ||= 'no-cache'
[status, headers.merge(self.default_chunked_headers)]
else
View
3 test/controller/chunked_transport_test.rb
@@ -20,8 +20,11 @@ def app
def test_headers
get '/' do |status, headers, body|
assert_equal 200, status
+
assert_equal "chunked", headers["Transfer-Encoding"]
assert_equal "text/html", headers["Content-Type"]
+ assert_equal "no-cache", headers["Cache-Control"]
+
assert_kind_of Cramp::Body, body
EM.stop

0 comments on commit 0511fd6

Please sign in to comment.
Something went wrong with that request. Please try again.