class Rack::Lint::Wrapper

def check_hijack(env)

#
# connection.
# It is intended to be used when applications need access to raw HTTP/1
#
# ignores any response generated by the application.
# occurs before any headers are written and causes the request to
# Full hijack is used to completely take over an HTTP/1 connection. It
#
# ==== Full Hijack
#
# backwards compatibility with older Rack versions.
# equivalent to streaming bodies, and is still optionally supported for
# Full hijacking only works with HTTP/1. Partial hijacking is functionally
#
# responsible for closing the hijacked stream.
# just the response body stream. In both cases, the application is
# connection, and partial hijacking where the application takes over
# interfaces: full hijacking where the application takes over the raw
# control of the HTTP connection. There are two distinct hijack
# The hijacking interfaces provides a means for an application to take
#
# === Hijacking
#
def check_hijack(env)
  ## If +rack.hijack+ is present in +env+, it must respond to +call+
  if original_hijack = env[RACK_HIJACK]
    raise LintError, "rack.hijack must respond to call" unless original_hijack.respond_to?(:call)
    env[RACK_HIJACK] = proc do
      io = original_hijack.call
      ## and return an +IO+ instance which can be used to read and write
      ## to the underlying connection using HTTP/1 semantics and
      ## formatting.
      raise LintError, "rack.hijack must return an IO instance" unless io.is_a?(IO)
      io
    end
  end
end