diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-14 09:19:42 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-14 09:19:42 +0100 |
commit | 591fcbafcd2eea58ac2ede2bb4daed8c713d07da (patch) | |
tree | 9e7688e4a104eae5f8f591cbee339e051ac31d6c /actionpack/lib | |
parent | b1e555142236a6b2fbb36bd80e5a0799e52e434b (diff) | |
download | rails-591fcbafcd2eea58ac2ede2bb4daed8c713d07da.tar.gz rails-591fcbafcd2eea58ac2ede2bb4daed8c713d07da.tar.bz2 rails-591fcbafcd2eea58ac2ede2bb4daed8c713d07da.zip |
Add begin/ensure block since we are returning.
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? |