]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: unskip TestEarlyHintsRequest_h2
authorKévin Dunglas <kevin@dunglas.fr>
Tue, 17 May 2022 19:33:28 +0000 (19:33 +0000)
committerDamien Neil <dneil@google.com>
Tue, 17 May 2022 20:51:53 +0000 (20:51 +0000)
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>
src/go.mod
src/go.sum
src/net/http/clientserver_test.go
src/net/http/h2_bundle.go
src/vendor/modules.txt

index 3a6cf5628654e56ffb086a274639e328b001150c..2b4d8b4b753803b76321cf2c6f9bec638cddb134 100644 (file)
@@ -4,7 +4,7 @@ go 1.19
 
 require (
        golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8
-       golang.org/x/net v0.0.0-20220516155154-20f960328961
+       golang.org/x/net v0.0.0-20220517181318-183a9ca12b87
 )
 
 require (
index 82985861b01d9c0475949e6007df80f258f0d0d3..0620cb5a09707f7ba5281fd11b335f18562906f5 100644 (file)
@@ -2,6 +2,8 @@ golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8 h1:y+mHpWoQJNAHt26Nhh6JP7
 golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/net v0.0.0-20220516155154-20f960328961 h1:+W/iTMPG0EL7aW+/atntZwZrvSRIj3m3yX414dSULUU=
 golang.org/x/net v0.0.0-20220516155154-20f960328961/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220517181318-183a9ca12b87 h1:cCR+9mKLOGyX4Zx+uBZDXEDAQsvKQ/XbW4vreG5v1jU=
+golang.org/x/net v0.0.0-20220517181318-183a9ca12b87/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a h1:N2T1jUrTQE9Re6TFF5PhvEHXHCguynGhKjWVsIUt5cY=
 golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/text v0.3.8-0.20220509174342-b4bca84b0361 h1:h+pU/hCb7sEApigI6eII3/Emx5ZHaFWS+nulUp0Az/k=
index 3fc9fcf19d7a975c3234e96fb111099f8dcc663f..b472ca4b7860a38681b6a3da6f2ce9715d1d2785 100644 (file)
@@ -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)
index dfb1adbf30e350e7ff12fe8626ac083abd8b0d15..53fbe9352aa8f0c993d455b6f6c688aaaa4184f0 100644 (file)
@@ -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,
index 5cb80bfbd50d13d657e98f53c85719522155b27d..d0fe779a5c821d69ed08320144a5883c9ab8d4b4 100644 (file)
@@ -9,7 +9,7 @@ golang.org/x/crypto/curve25519/internal/field
 golang.org/x/crypto/hkdf
 golang.org/x/crypto/internal/poly1305
 golang.org/x/crypto/internal/subtle
-# golang.org/x/net v0.0.0-20220516155154-20f960328961
+# golang.org/x/net v0.0.0-20220517181318-183a9ca12b87
 ## explicit; go 1.17
 golang.org/x/net/dns/dnsmessage
 golang.org/x/net/http/httpguts