]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: fix typo in TestTransportReadToEndReusesConn
authorKeiichi Hirobe <chalenge.akane@gmail.com>
Wed, 5 Aug 2020 16:57:11 +0000 (01:57 +0900)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Sat, 24 Oct 2020 02:36:08 +0000 (02:36 +0000)
The test sets a Content-Type where it looks like it wants a Content-Length. The test passes because the Content-Length header is automatically added anyway, but fix the typo and set Content-Length as intended.

Change-Id: Ic2af778f82c3e9d58e164892f6ac6ef5745f884f
Reviewed-on: https://go-review.googlesource.com/c/go/+/246977
Reviewed-by: Damien Neil <dneil@google.com>
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/net/http/transport_test.go

index 58f0d9db989e8f2d304f827084e292bab65a4f91..e69133e7868f4ddcd578eaf115d9556aa8bd3ee8 100644 (file)
@@ -412,7 +412,7 @@ func TestTransportReadToEndReusesConn(t *testing.T) {
                        w.WriteHeader(200)
                        w.(Flusher).Flush()
                } else {
-                       w.Header().Set("Content-Type", strconv.Itoa(len(msg)))
+                       w.Header().Set("Content-Length", strconv.Itoa(len(msg)))
                        w.WriteHeader(200)
                }
                w.Write([]byte(msg))