diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-01-22 23:52:14 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-01-22 23:54:37 +0000 |
commit | fedb5e50829e6dfad30ca18ea525c812eccbec70 (patch) | |
tree | f00c797fa7838218128086fa217c92d3d47ab8f1 /t/hijack.ru | |
parent | 705cf5fcf8ccb37deef5d2b922d6d78d34765c5b (diff) | |
download | unicorn-fedb5e50829e6dfad30ca18ea525c812eccbec70.tar.gz |
Once a connection is hijacked, we ignore it completely and leave the connection at the mercy of the application.
Diffstat (limited to 't/hijack.ru')
-rw-r--r-- | t/hijack.ru | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/hijack.ru b/t/hijack.ru index 105e0d7..fcb0b6d 100644 --- a/t/hijack.ru +++ b/t/hijack.ru @@ -17,7 +17,12 @@ run lambda { |env| io = env["rack.hijack"].call if io.respond_to?(:read_nonblock) && env["rack.hijack_io"].respond_to?(:read_nonblock) - return [ 200, {}, [ "hijack.OK\n" ] ] + + # exercise both, since we Rack::Lint may use different objects + env["rack.hijack_io"].write("HTTP/1.0 200 OK\r\n\r\n") + io.write("request.hijacked") + io.close + return [ 500, {}, DieIfUsed.new ] end end [ 500, {}, [ "hijack BAD\n" ] ] |