diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-14 09:18:57 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-14 09:18:57 +0100 |
commit | 78ef738313d66226854b688db6ab256d078b40bb (patch) | |
tree | e37f98bdd318bb8a4ce05fc83fcc87ecff1236d4 /actionpack/lib/action_dispatch/middleware/body_proxy.rb | |
parent | 70b762d1a744c2bec725de5f96610ddeb6c07a5d (diff) | |
download | rails-78ef738313d66226854b688db6ab256d078b40bb.tar.gz rails-78ef738313d66226854b688db6ab256d078b40bb.tar.bz2 rails-78ef738313d66226854b688db6ab256d078b40bb.zip |
Add begin/ensure block since we are returning.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/body_proxy.rb')
-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? |