aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2026-03-03 15:39:59 -0800
committerGopher Robot <gobot@golang.org>2026-03-12 08:10:02 -0700
commit9d3210150b470d5a740d9e7bc405d863846ef999 (patch)
treea2ba64ee66f5c19ecb554263fa0a07fafb12ab1a /src/net/http
parentd6d0f5e08d9d419b87c2ad58a19b61c3f9ba709e (diff)
downloadgo-9d3210150b470d5a740d9e7bc405d863846ef999.tar.xz
net/http/internal/http2: remove TestServerUpgradeRequestPrefaceFailure
This test exercises the h2c upgrade path, where a client sends an HTTP/1 requests and receives an HTTP/2 response. We don't support this path any more, so drop the test. For #67810 Change-Id: Ib100c3afb18a98f613c19023cb2d5a026a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/751308 Reviewed-by: Nicholas Husin <nsh@golang.org> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <husin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/internal/http2/server_test.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/net/http/internal/http2/server_test.go b/src/net/http/internal/http2/server_test.go
index 4cfa5e5331..9137151955 100644
--- a/src/net/http/internal/http2/server_test.go
+++ b/src/net/http/internal/http2/server_test.go
@@ -4705,29 +4705,6 @@ func testServerContinuationAfterInvalidHeader(t testing.TB) {
}
}
-func TestServerUpgradeRequestPrefaceFailure(t *testing.T) {
- synctestTest(t, testServerUpgradeRequestPrefaceFailure)
-}
-func testServerUpgradeRequestPrefaceFailure(t testing.TB) {
- // An h2c upgrade request fails when the client preface is not as expected.
- s2 := &Server{
- // Setting IdleTimeout triggers #67168.
- IdleTimeout: 60 * time.Minute,
- }
- c1, c2 := net.Pipe()
- donec := make(chan struct{})
- go func() {
- defer close(donec)
- s2.ServeConn(c1, &ServeConnOpts{
- UpgradeRequest: httptest.NewRequest("GET", "/", nil),
- })
- }()
- // The server expects to see the HTTP/2 preface,
- // but we close the connection instead.
- c2.Close()
- <-donec
-}
-
// Issue 67036: A stream error should result in the handler's request context being canceled.
func TestServerRequestCancelOnError(t *testing.T) { synctestTest(t, testServerRequestCancelOnError) }
func testServerRequestCancelOnError(t testing.TB) {