Skip to content

Commit

Permalink
fix: rack mock
Browse files Browse the repository at this point in the history
! backport for fixed rack mock
  • Loading branch information
majioa committed Dec 31, 2023
1 parent 9cbe21e commit 66001eb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/rack/mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,15 @@ def body
# end
buffer = String.new

super.each do |chunk|
buffer << chunk
body = super
body = body.body if body.respond_to?(:body)

if body.respond_to?(:each)
body.each do |chunk|
buffer << chunk
end
else
buffer = body.to_s
end

return buffer
Expand Down

0 comments on commit 66001eb

Please sign in to comment.