Skip to content

chore(deps): golang.org/x/net 0.59.0, x/text 0.42.0; stdlib h2c transports in the tests - #581

Merged
FumingPower3925 merged 1 commit into
mainfrom
chore/x-net-0.59
Sep 13, 2026
Merged

FumingPower3925 merged 1 commit into
mainfrom
chore/x-net-0.59

Conversation

@FumingPower3925

Copy link
Copy Markdown
Contributor

Supersedes #577, which could not pass lint on its own: x/net 0.59 deprecates http2.Server and http2.Transport in favour of net/http's Protocols.

Engine (std, one line): h2c.NewHandler stays, 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 in engine/std/engine.go records the #440 regression that removing it caused). The one http2.Server literal the handler takes now sits on a single line under the same staticcheck waiver. No behaviour change.

Tests: every prior-knowledge h2c client that used http2.Transport{AllowHTTP: true, DialTLSContext: …} (7 files, 10 sites) now uses http.Transport{Protocols: h2cOnly()}, where h2cOnly sets SetUnencryptedHTTP2(true); the stdlib dials plaintext TCP through DialContext and 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 with GOOS=linux; go mod tidy is a no-op in all 10 modules. In a golang:1.27 container with seccomp=unconfined: ./adaptive -run Transplant, ./middleware/sse -run Disconnect (all 16 engine×mode subtests), ./test/spec, ./test/conformance and ./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).

… 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).
@FumingPower3925 FumingPower3925 added this to the v1.6.0 milestone Sep 13, 2026
@FumingPower3925
FumingPower3925 merged commit e460a72 into main Sep 13, 2026
34 checks passed
@FumingPower3925
FumingPower3925 deleted the chore/x-net-0.59 branch September 13, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant