fix: Get rid of deprecated x/net/http2/h2c#7424
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR removes the x/net/http2/h2c handler wrapper and switches to configuring HTTP protocol support via net/http’s Server.Protocols, aiming to reduce direct dependencies on golang.org/x/net.
Changes:
- Replaced
h2c.NewHandler(..., &http2.Server{})with plain handlers plusServer.Protocolsconfiguration. - Moved
golang.org/x/netfrom a direct to an indirectgo.moddependency. - Updated inline documentation to remove references to
h2cframing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| runs/test/api/setup_test.go | Replaces h2c-wrapped test server handler with protocol configuration on http.Server. |
| go.mod | Drops direct requirement on golang.org/x/net, retaining it indirectly. |
| flytestdlib/app/app.go | Updates production server wiring to use Server.Protocols instead of x/net/http2/h2c and tweaks related comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2cc94d9 to
b1ecf68
Compare
b1ecf68 to
6cde04b
Compare
6cde04b to
ef4c9d7
Compare
Sovietaced
reviewed
May 26, 2026
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
3ca3358 to
c761d47
Compare
Sovietaced
approved these changes
May 26, 2026
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.
Why are the changes needed?
Go 1.25 added native support for unencrypted HTTP/2 (h2c) directly in the standard
net/http. This PR removes the dependency on the deprecated packagegolang.org/x/net/http2/h2c.What changes were proposed in this pull request?
golang.org/x/net/http2/h2cusage with the native Go 1.25http.ProtocolsAPI in two places:depguardlinter inflytestdlib/.golangci.ymlto prevent future regressions.How was this patch tested?
Both files compile cleanly with go build. The behavior is equivalent - the server continues to accept both HTTP/1.1 and unencrypted HTTP/2 connections.
Labels
Setup process
Screenshots
Related PRs
Stack
Docs link
https://pkg.go.dev/golang.org/x/net/http2/h2c - deprecated package being replaced