mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
remove check for string from request body setter
it was required on ruby 1.8
This commit is contained in:
parent
893d38d7fd
commit
127d2c8299
1 changed files with 1 additions and 8 deletions
|
@ -121,14 +121,7 @@ module ActionDispatch # :nodoc:
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue