aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-10-18 21:42:09 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2016-10-18 21:53:31 +0000
commit97b04152bc3d9df1155bc97d9e6095f69b6882c7 (patch)
tree088239cfdd06820551b91b89b348d3e13cc1d362 /src/net/http
parent75fef5a0f60bcace88a8d7470df2d85d8eee048f (diff)
downloadgo-97b04152bc3d9df1155bc97d9e6095f69b6882c7.tar.xz
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>
Diffstat (limited to 'src/net/http')
-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 53e0be680b..f552424189 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) {