diff options
Diffstat (limited to 'lib/rack/head.rb')
-rw-r--r-- | lib/rack/head.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/rack/head.rb b/lib/rack/head.rb index 3bd9a75b..c1c430f6 100644 --- a/lib/rack/head.rb +++ b/lib/rack/head.rb @@ -12,17 +12,15 @@ module Rack end def call(env) - status, headers, body = @app.call(env) + _, _, body = response = @app.call(env) if env[REQUEST_METHOD] == HEAD - [ - status, headers, Rack::BodyProxy.new([]) do - body.close if body.respond_to? :close - end - ] - else - [status, headers, body] + response[2] = Rack::BodyProxy.new([]) do + body.close if body.respond_to? :close + end end + + response end end end |