diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/body_proxy.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/body_proxy.rb b/actionpack/lib/action_dispatch/middleware/body_proxy.rb index 867afe3b48..739b9e427a 100644 --- a/actionpack/lib/action_dispatch/middleware/body_proxy.rb +++ b/actionpack/lib/action_dispatch/middleware/body_proxy.rb @@ -12,9 +12,11 @@ module ActionDispatch def close return if @closed @closed = true - @body.close if @body.respond_to? :close - ensure - @block.call + begin + @body.close if @body.respond_to? :close + ensure + @block.call + end end def closed? |