From 2f3c778b232dd53c41e1b623d25cd9f4ab28aaa5 Mon Sep 17 00:00:00 2001 From: "Nicholas S. Husin" Date: Mon, 30 Mar 2026 19:17:03 -0400 Subject: net/http: add support for running HTTP tests against HTTP/3 Add support within clientserver_test.go to bring up a test HTTP/3 server and client when http3Mode testMode option is passed. To be able to reuse net/http/httptest, net/http/httptest.Server.StartTLS (and Start) have been modified so they can be called with a nil Listener. In such cases, both methods will behave identically as usual, but will not actually make its server serve or set its transport dialer, both of which requires having a listener. This should be a no-op for regular users of the package, whose entrypoint via functions such as NewServer will automatically set a local listener. Actually enabling HTTP/3 for our tests will be done in a separate CL. For #70914 Change-Id: Ibc5fc83287b6a04b46e668a54924761a92b620a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/740122 Reviewed-by: Damien Neil Reviewed-by: Nicholas Husin LUCI-TryBot-Result: Go LUCI --- src/net/http/export_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/net/http/export_test.go') diff --git a/src/net/http/export_test.go b/src/net/http/export_test.go index b499769c4f..300785d20d 100644 --- a/src/net/http/export_test.go +++ b/src/net/http/export_test.go @@ -33,6 +33,7 @@ var ( Export_writeStatusLine = writeStatusLine Export_is408Message = is408Message MaxPostCloseReadTime = maxPostCloseReadTime + ProtocolSetHTTP3 = protocolSetHTTP3 ) var MaxWriteWaitBeforeConnReuse = &maxWriteWaitBeforeConnReuse -- cgit v1.3-6-g1900