aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-10-18 21:42:09 +0000
committerChris Broadfoot <cbro@golang.org>2016-10-18 23:50:01 +0000
commit740dfbadbd7e54e0340f43bf698f71007bee9f8b (patch)
treebff801c8c17463386daf3cb6bc6b42f971c8d5a3
parentedecc650ec95ac1a96d2312980e18d959f89835e (diff)
downloadgo-740dfbadbd7e54e0340f43bf698f71007bee9f8b.tar.gz
go-740dfbadbd7e54e0340f43bf698f71007bee9f8b.zip
[release-branch.go1.7] net/http: update test to check Content-Length 0 Body more reliably
The way to send an explicitly-zero Content-Length is to set a nil Body. Fix this test to do that, rather than relying on type sniffing. Updates #17480 Updates #17071 Change-Id: I6a38e20f17013c88ec4ea69d73c507e4ed886947 Reviewed-on: https://go-review.googlesource.com/31434 TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org> Reviewed-on: https://go-review.googlesource.com/31437 Run-TryBot: Chris Broadfoot <cbro@golang.org>
-rw-r--r--src/net/http/clientserver_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go
index e12ea0c8c4..8caba285bd 100644
--- a/src/net/http/clientserver_test.go
+++ b/src/net/http/clientserver_test.go
@@ -468,7 +468,7 @@ func TestH12_RequestContentLength_Known_NonZero(t *testing.T) {
}
func TestH12_RequestContentLength_Known_Zero(t *testing.T) {
- h12requestContentLength(t, func() io.Reader { return strings.NewReader("") }, 0)
+ h12requestContentLength(t, func() io.Reader { return nil }, 0)
}
func TestH12_RequestContentLength_Unknown(t *testing.T) {