aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorKévin Dunglas <kevin@dunglas.fr>2022-05-17 19:33:28 +0000
committerDamien Neil <dneil@google.com>2022-05-17 20:51:53 +0000
commitb2ae2f5358e87fabd519bc2de20b3ab81d733820 (patch)
treef795a0cf2cb219d17f98305ba0dfe42ebc7625d8 /src/net/http
parent7607888df0eca35dadb0529960d7965d0d6f4072 (diff)
downloadgo-b2ae2f5358e87fabd519bc2de20b3ab81d733820.tar.xz
net/http: unskip TestEarlyHintsRequest_h2
golang/net#134 and golang/net#96 have been merged. This patch updates h2_bundle.go and enables TestEarlyHintsRequest_h2. Change-Id: Ia53fee6b3c4892a7cde10e7b62cbe7b64fa9f155 GitHub-Last-Rev: ea521b02ae1e873f9b8be6a2a3e81699d8eb5584 GitHub-Pull-Request: golang/go#52947 Reviewed-on: https://go-review.googlesource.com/c/go/+/406914 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/clientserver_test.go3
-rw-r--r--src/net/http/h2_bundle.go8
2 files changed, 8 insertions, 3 deletions
diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go
index 3fc9fcf19d..b472ca4b78 100644
--- a/src/net/http/clientserver_test.go
+++ b/src/net/http/clientserver_test.go
@@ -1624,9 +1624,6 @@ func TestEarlyHintsRequest_h1(t *testing.T) { testEarlyHintsRequest(t, h1Mode) }
func TestEarlyHintsRequest_h2(t *testing.T) { testEarlyHintsRequest(t, h2Mode) }
func testEarlyHintsRequest(t *testing.T, h2 bool) {
defer afterTest(t)
- if h2 {
- t.Skip("Waiting for H2 support to be merged: https://go-review.googlesource.com/c/net/+/406494")
- }
var wg sync.WaitGroup
wg.Add(1)
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index dfb1adbf30..53fbe9352a 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -6401,6 +6401,14 @@ func (rws *http2responseWriterState) writeHeader(code int) {
// Per RFC 8297 we must not clear the current header map
h := rws.handlerHeader
+ _, cl := h["Content-Length"]
+ _, te := h["Transfer-Encoding"]
+ if cl || te {
+ h = h.Clone()
+ h.Del("Content-Length")
+ h.Del("Transfer-Encoding")
+ }
+
if rws.conn.writeHeaders(rws.stream, &http2writeResHeaders{
streamID: rws.stream.id,
httpResCode: code,