Skip to content

Commit

Permalink
Fix threshold when content type is not set before rendering.
Browse files Browse the repository at this point in the history
Content-Type is implicitly set in response.prepare!, but that is
called after setting the body to avoid setting a content length.
  • Loading branch information
oggy committed Apr 28, 2010
1 parent 59920f1 commit 3281177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
== LATEST

* Fix threshold when content type is not set before rendering.

== 0.0.6 2010-04-28

* Fix #render_to_string.
Expand Down
3 changes: 2 additions & 1 deletion lib/template_streaming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def with_template_streaming_condition(*args)
# anything will be rendered.
#
def progressive_rendering_threshold
response.header['Content-type'] =~ %r'\Atext/html' or
content_type = response.header['Content-type']
content_type.nil? || content_type =~ %r'\Atext/html' or
return 0

case request.env['HTTP_USER_AGENT']
Expand Down

0 comments on commit 3281177

Please sign in to comment.