chore(deps): golang.org/x/net 0.59.0, x/text 0.42.0; stdlib h2c transports in the tests - #581
Merged
Merged
Conversation
… h2c clients to the stdlib transport
x/net 0.59 deprecates http2.Server and http2.Transport in favour of
net/http's Protocols. The std engine keeps h2c.NewHandler because the
stdlib's unencrypted HTTP/2 does not perform the RFC 7540 3.2 Upgrade
handshake that epoll and io_uring honour (see the import comment), so the
one http2.Server literal it needs carries the same staticcheck waiver as
the handler, on a single line so the waiver covers the deprecated fields.
Every test client that dialled prior-knowledge h2c through
http2.Transport{AllowHTTP: true, DialTLSContext: ...} now uses
http.Transport with Protocols.SetUnencryptedHTTP2(true), which dials
plaintext TCP through DialContext and speaks HTTP/2 from the first byte.
The per-package h2cOnly helpers keep the shape in one place.
Supersedes #577 (dependabot could not clear the lint gate on its own).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #577, which could not pass lint on its own: x/net 0.59 deprecates
http2.Serverandhttp2.Transportin favour ofnet/http'sProtocols.Engine (std, one line):
h2c.NewHandlerstays, because the stdlib's unencrypted HTTP/2 does not perform the RFC 7540 3.2 Upgrade handshake that epoll and io_uring honour (the import comment inengine/std/engine.gorecords the #440 regression that removing it caused). The onehttp2.Serverliteral the handler takes now sits on a single line under the samestaticcheckwaiver. No behaviour change.Tests: every prior-knowledge h2c client that used
http2.Transport{AllowHTTP: true, DialTLSContext: …}(7 files, 10 sites) now useshttp.Transport{Protocols: h2cOnly()}, whereh2cOnlysetsSetUnencryptedHTTP2(true); the stdlib dials plaintext TCP throughDialContextand speaks HTTP/2 from the first byte. The two sites that capture the raw conn keep their dialer.Verified locally (golangci-lint 2.13.2, the CI version):
golangci-lint run ./...reports 0 issues on darwin and withGOOS=linux;go mod tidyis a no-op in all 10 modules. In agolang:1.27container withseccomp=unconfined:./adaptive -run Transplant,./middleware/sse -run Disconnect(all 16 engine×mode subtests),./test/spec,./test/conformanceand./test/integration -run 'Hybrid|H2C|h2c'pass.Milestone: v1.6.0 (the bump ships in this release per the maintainer's decision of 2026-09-13).