lib/rack/show_status.rb in rack-2.1.4.4 vs lib/rack/show_status.rb in rack-2.2.0

- old
+ new

@@ -1,10 +1,8 @@ # frozen_string_literal: true require 'erb' -require 'rack/request' -require 'rack/utils' module Rack # Rack::ShowStatus catches all empty responses and replaces them # with a site explaining the error. # @@ -18,10 +16,10 @@ @template = ERB.new(TEMPLATE) end def call(env) status, headers, body = @app.call(env) - headers = Utils::HeaderHash.new(headers) + headers = Utils::HeaderHash[headers] empty = headers[CONTENT_LENGTH].to_i <= 0 # client or server error, or explicit message if (status.to_i >= 400 && empty) || env[RACK_SHOWSTATUS_DETAIL] # This double assignment is to prevent an "unused variable" warning on