Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

remove check for string from request body setter
  • Loading branch information...
commit 2ba3d135e375e05b3f114013bc0608d6bcd045a4 2 parents 987ca2a + 127d2c8
@josevalim josevalim authored
Showing with 1 addition and 8 deletions.
  1. +1 −8 actionpack/lib/action_dispatch/http/response.rb
View
9 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
Please sign in to comment.
Something went wrong with that request. Please try again.