Permalink
Browse files

Merge pull request #4094 from lest/remove-1-8-code

remove check for string from request body setter
  • Loading branch information...
2 parents 987ca2a + 127d2c8 commit 2ba3d135e375e05b3f114013bc0608d6bcd045a4 @josevalim josevalim committed Dec 21, 2011
Showing with 1 addition and 8 deletions.
  1. +1 −8 actionpack/lib/action_dispatch/http/response.rb
@@ -121,14 +121,7 @@ def body
def body=(body)
@blank = true if body == EMPTY
- # Explicitly check for strings. This is *wrong* theoretically
- # but if we don't check this, the performance on string bodies
- # is bad on Ruby 1.8 (because strings responds to each then).
- @body = if body.respond_to?(:to_str) || !body.respond_to?(:each)
- [body]
- else
- body
- end
+ @body = body.respond_to?(:each) ? body : [body]
end
def body_parts

0 comments on commit 2ba3d13

Please sign in to comment.