test/test_proxy_pass.rb in yahns-1.12.4 vs test/test_proxy_pass.rb in yahns-1.12.5
- old
+ new
@@ -570,9 +570,19 @@
end
thrs.each { |t| assert_equal(:OK, t.value) }
end
def check_eof_body(host, port)
+ Timeout.timeout(30) do
+ s = TCPSocket.new(host, port)
+ s.write("GET /eof-body-fast HTTP/1.0\r\nConnection:keep-alive\r\n\r\n")
+ res = s.read
+ assert_match %r{\AHTTP/1\.[01] 200 OK\r\n}, res
+ assert_match %r{\r\nConnection: close\r\n}, res
+ assert_match %r{\r\n\r\neof-body-fast\z}, res
+ s.close
+ end
+
Timeout.timeout(60) do
s = TCPSocket.new(host, port)
s.write("GET /eof-body-fast HTTP/1.0\r\n\r\n")
res = s.read
assert_match %r{\AHTTP/1\.1 200 OK\r\n}, res