aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/internal/http2/write.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2026-03-03 08:12:25 -0800
committerGopher Robot <gobot@golang.org>2026-03-12 08:13:20 -0700
commit080aa8e9647e5211650f34f3a93fb493afbe396d (patch)
treeab00dcd761d3622f08ff5aa7e2a52ff8c1fd0591 /src/net/http/internal/http2/write.go
parent81908597a8787b09b1da90e7c6d3461b4302820f (diff)
downloadgo-080aa8e9647e5211650f34f3a93fb493afbe396d.tar.xz
net/http: use net/http/internal/http2 rather than h2_bundle.go
Rework net/http/internal/http2 to use internally-defined types rather than net/http types (to avoid an import cycle). Remove h2_bundle.go, and replace it with calls into net/http/internal/http2 instead. For #67810 Change-Id: I56a1b28dbd0e302ab15a30f819dd46256a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/751304 Reviewed-by: Nicholas Husin <nsh@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <husin@google.com>
Diffstat (limited to 'src/net/http/internal/http2/write.go')
-rw-r--r--src/net/http/internal/http2/write.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/net/http/internal/http2/write.go b/src/net/http/internal/http2/write.go
index 0691934f79..59c4e625a5 100644
--- a/src/net/http/internal/http2/write.go
+++ b/src/net/http/internal/http2/write.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"log"
- "net/http"
"net/http/internal/httpcommon"
"net/url"
@@ -189,9 +188,9 @@ func splitHeaderBlock(ctx writeContext, headerBlock []byte, fn func(ctx writeCon
// for HTTP response headers or trailers from a server handler.
type writeResHeaders struct {
streamID uint32
- httpResCode int // 0 means no ":status" line
- h http.Header // may be nil
- trailers []string // if non-nil, which keys of h to write. nil means all.
+ httpResCode int // 0 means no ":status" line
+ h Header // may be nil
+ trailers []string // if non-nil, which keys of h to write. nil means all.
endStream bool
date string
@@ -263,7 +262,7 @@ type writePushPromise struct {
streamID uint32 // pusher stream
method string // for :method
url *url.URL // for :scheme, :authority, :path
- h http.Header
+ h Header
// Creates an ID for a pushed stream. This runs on serveG just before
// the frame is written. The returned ID is copied to promisedID.
@@ -341,7 +340,7 @@ func (wu writeWindowUpdate) writeFrame(ctx writeContext) error {
// encodeHeaders encodes an http.Header. If keys is not nil, then (k, h[k])
// is encoded only if k is in keys.
-func encodeHeaders(enc *hpack.Encoder, h http.Header, keys []string) {
+func encodeHeaders(enc *hpack.Encoder, h Header, keys []string) {
if keys == nil {
sorter := sorterPool.Get().(*sorter)
// Using defer here, since the returned keys from the