diff options
author | Eric Wong <e@80x24.org> | 2015-06-09 22:15:25 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-06-10 09:20:31 +0000 |
commit | 91e4f202d4db4ebcb9a4eb863d4598f3c0f73858 (patch) | |
tree | 1090daac95fc83d76afbc1c5aedc26d2a3b41b59 /test/test_ssl.rb | |
parent | 8e5d64502e478c7e93d7168628d97f66417fcabe (diff) | |
download | yahns-91e4f202d4db4ebcb9a4eb863d4598f3c0f73858.tar.gz |
Middlewares such as Rack::Lock (used by Rails) break badly unless the response body is closed on hijack, so we will close it to follow the lead of other popular Rack servers. While it's unclear if there's anybody using rack.hijack besides yahns/proxy_pass we'll try to emulate the behavior of other servers as much as possible. ref: https://github.com/ngauthier/tubesock/issues/10 While we're at it, use DieIfUsed correctly in test_ssl.rb :x
Diffstat (limited to 'test/test_ssl.rb')
-rw-r--r-- | test/test_ssl.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb index 8f01ef7..c54cc3c 100644 --- a/test/test_ssl.rb +++ b/test/test_ssl.rb @@ -124,10 +124,11 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC p [ :ERR, req ] end until s.closed? end - [ 200, DieIfUsed, DieIfUsed ] + [ 200, DieIfUsed.new, DieIfUsed.new ] end app(:rack, ru) { listen "#{host}:#{port}", ssl_ctx: ctx } logger(Logger.new(err.path)) + stderr_path err.path end end client = ssl_client(host, port) @@ -147,6 +148,8 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC %w(a b c d).each { |x| client.puts(x) } assert_equal "abcd", client.gets.strip end + errs = File.readlines(err.path).grep(/DieIfUsed/) + assert_equal([ "INFO #{pid} closed DieIfUsed 1\n" ], errs) ensure client.close if client quit_wait(pid) |