From 3e6bc9fb589fd88469349a38a77704c3333623e0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 5 Jun 2023 10:12:48 +0000 Subject: [PATCH 19/23] test_server: drop early_hints test t/integration.t already is more complete in that it tests both Rack 2 and 3 along with both possible values of check_client_connection. --- test/unit/test_server.rb | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb index fe98fcc..0a710d1 100644 --- a/test/unit/test_server.rb +++ b/test/unit/test_server.rb @@ -23,17 +23,6 @@ def call(env) end end -class TestEarlyHintsHandler - def call(env) - while env['rack.input'].read(4096) - end - env['rack.early_hints'].call( - "Link" => "; rel=preload; as=style\n; rel=preload" - ) - [200, { 'content-type' => 'text/plain' }, ['hello!\n']] - end -end - class TestRackAfterReply def initialize @called = false @@ -112,26 +101,6 @@ def test_preload_app_config tmp.close! end - def test_early_hints - teardown - redirect_test_io do - @server = HttpServer.new(TestEarlyHintsHandler.new, - :listeners => [ "127.0.0.1:#@port"], - :early_hints => true) - @server.start - end - - sock = tcp_socket('127.0.0.1', @port) - sock.syswrite("GET / HTTP/1.0\r\n\r\n") - - responses = sock.read(4096) - assert_match %r{\AHTTP/1.[01] 103\b}, responses - assert_match %r{^Link: }, responses - assert_match %r{^Link: }, responses - - assert_match %r{^HTTP/1.[01] 200\b}, responses - end - def test_after_reply teardown