mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #4094 from lest/remove-1-8-code
remove check for string from request body setter
This commit is contained in:
commit
2ba3d135e3
1 changed files with 1 additions and 8 deletions
|
@ -121,14 +121,7 @@ module ActionDispatch # :nodoc:
|
||||||
def body=(body)
|
def body=(body)
|
||||||
@blank = true if body == EMPTY
|
@blank = true if body == EMPTY
|
||||||
|
|
||||||
# Explicitly check for strings. This is *wrong* theoretically
|
@body = body.respond_to?(:each) ? body : [body]
|
||||||
# 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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def body_parts
|
def body_parts
|
||||||
|
|
Loading…
Reference in a new issue