1 # frozen_string_literal: true
3 require_relative 'constants'
4 require_relative 'body_proxy'
7 # Rack::Head returns an empty body for all HEAD requests. It leaves
8 # all other requests unchanged.
15 _, _, body = response = @app.call(env)
17 if env[REQUEST_METHOD] == HEAD
18 response[2] = Rack::BodyProxy.new([]) do
19 body.close if body.respond_to? :close