2 use Rack::ContentLength
3 use Rack::ContentType, "text/plain"
6 abort "body.each called after response hijack\n"
10 abort "body.close called after response hijack\n"
16 if env["rack.hijack?"]
17 io = env["rack.hijack"].call
18 if io.respond_to?(:read_nonblock) &&
19 env["rack.hijack_io"].respond_to?(:read_nonblock)
20 return [ 200, {}, [ "hijack.OK\n" ] ]
23 [ 500, {}, [ "hijack BAD\n" ] ]
25 r = "response.hijacked"
28 "Content-Length" => r.bytesize.to_s,
29 "rack.hijack" => proc do |io|