class Protocol::Rack::Adapter::Rack3
def self.make_response(env, response)
@parameter response [Protocol::HTTP::Response] The HTTP response.
@parameter env [Hash] The rack environment.
Unlike Rack 2, this adapter forces streaming responses by converting the body to a callable.
Handles protocol upgrades and streaming responses.
Convert a {Protocol::HTTP::Response} into a Rack 3 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? # Force streaming response: body = body.method(:call) end [response.status, headers, body] end