From 4c75813ebec5a55c8294188576fc516bfbf4e44b Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Wed, 14 Dec 2022 10:49:29 -0800 Subject: [PATCH] [release-branch.go1.19] all: upgrade golang.org/x/net to v0.0.0-20221214163817-183621ab9c4e Update x/net to include the fix for #53960. For #53960 For #56154 Change-Id: Ib3e0d66e4125601e20f1b2e3040f29e7ebd4b080 Reviewed-on: https://go-review.googlesource.com/c/go/+/457556 Run-TryBot: Damien Neil TryBot-Result: Gopher Robot Reviewed-by: Than McIntosh --- h2_bundle.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/h2_bundle.go b/h2_bundle.go index c69d6c1e..2e5ef078 100644 --- a/h2_bundle.go +++ b/h2_bundle.go @@ -5764,12 +5764,6 @@ func (sc *http2serverConn) newWriterAndRequest(st *http2stream, f *http2MetaHead return nil, nil, sc.countError("bad_path_method", http2streamError(f.StreamID, http2ErrCodeProtocol)) } - bodyOpen := !f.StreamEnded() - if rp.method == "HEAD" && bodyOpen { - // HEAD requests can't have bodies - return nil, nil, sc.countError("head_body", http2streamError(f.StreamID, http2ErrCodeProtocol)) - } - rp.header = make(Header) for _, hf := range f.RegularFields() { rp.header.Add(sc.canonicalHeader(hf.Name), hf.Value) @@ -5782,6 +5776,7 @@ func (sc *http2serverConn) newWriterAndRequest(st *http2stream, f *http2MetaHead if err != nil { return nil, nil, err } + bodyOpen := !f.StreamEnded() if bodyOpen { if vv, ok := rp.header["Content-Length"]; ok { if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil {