class Protocol::Rack::Adapter::Rack2
def self.make_response(env, response)
@parameter response [Protocol::HTTP::Response] The HTTP response.
@parameter env [Hash] The rack environment.
Handles protocol upgrades and streaming responses.
Convert a {Protocol::HTTP::Response} into a Rack 2 response tuple.
def self.make_response(env, response) # These interfaces should be largely compatible: headers = response.headers.to_h self.extract_protocol(env, response, headers) if body = response.body and body.stream? if env[RACK_IS_HIJACK] headers[RACK_HIJACK] = body body = [] end end headers.transform_values! do |value| if value.is_a?(Array) value.join("\n") else value end end [response.status, headers, body] end