# File lib/rack/showstatus.rb, line 19 def call(env) status, headers, body = @app.call(env) # client or server error, or explicit message if status.to_i >= 400 && (body.empty? rescue false) || env["rack.showstatus.detail"] req = Rack::Request.new(env) message = Rack::Utils::HTTP_STATUS_CODES[status.to_i] || status.to_s detail = env["rack.showstatus.detail"] || message [status, headers.merge("Content-Type" => "text/html"), [@template.result(binding)]] else [status, headers, body] end end