aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/h2_bundle.go
diff options
context:
space:
mode:
authorCarlos Amedee <carlos@golang.org>2023-01-10 13:50:39 -0500
committerCarlos Amedee <carlos@golang.org>2023-01-10 13:50:39 -0500
commit7058c2cb4132291e1b6c9498a9a6f13a9a70ff85 (patch)
tree7701af5d953be20ade9ca141c562b3262c703716 /src/net/http/h2_bundle.go
parentfc1ed37e824b2f87e287e1bc4597253f1b30b3b3 (diff)
parent581603cb7d02019bbf4ff508014038f3120a3dcb (diff)
downloadgo-7058c2cb4132291e1b6c9498a9a6f13a9a70ff85.tar.gz
go-7058c2cb4132291e1b6c9498a9a6f13a9a70ff85.zip
[dev.boringcrypto.go1.18] all: merge go1.18.10 into dev.boringcrypto.go1.18dev.boringcrypto.go1.18
Change-Id: I0dcc4e288cba62382f6bd06b2cf0ff843309220c
Diffstat (limited to 'src/net/http/h2_bundle.go')
-rw-r--r--src/net/http/h2_bundle.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 381f91c8ad..3a21ecac3d 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -5760,12 +5760,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)
@@ -5778,6 +5772,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 {