components/golang-17/patches/0027-release-branch.go1.7-net-http-update-test-to-check-C.patch
author Shawn Walker-Salas <shawn.walker@oracle.com>
Tue, 20 Dec 2016 11:59:29 -0800
changeset 7518 c388d4e1d3ad
permissions -rw-r--r--
PSARC/2016/250 Google Go version 1.7 23170486 update to Google Go version 1.7 and add sparc64 support
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7518
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     1
From 740dfbadbd7e54e0340f43bf698f71007bee9f8b Mon Sep 17 00:00:00 2001
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     2
From: Brad Fitzpatrick <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     3
Date: Tue, 18 Oct 2016 21:42:09 +0000
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     4
Subject: [PATCH 27/38] [release-branch.go1.7] net/http: update test to check
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     5
 Content-Length 0 Body more reliably
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     6
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     7
The way to send an explicitly-zero Content-Length is to set a nil Body.
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     8
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
     9
Fix this test to do that, rather than relying on type sniffing.
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    10
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    11
Updates #17480
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    12
Updates #17071
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    13
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    14
Change-Id: I6a38e20f17013c88ec4ea69d73c507e4ed886947
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    15
Reviewed-on: https://go-review.googlesource.com/31434
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    16
TryBot-Result: Gobot Gobot <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    17
Run-TryBot: Brad Fitzpatrick <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    18
Reviewed-by: Chris Broadfoot <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    19
Reviewed-on: https://go-review.googlesource.com/31437
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    20
Run-TryBot: Chris Broadfoot <[email protected]>
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    21
---
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    22
 src/net/http/clientserver_test.go | 2 +-
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    23
 1 file changed, 1 insertion(+), 1 deletion(-)
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    24
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    25
diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    26
index e12ea0c..8caba28 100644
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    27
--- a/src/net/http/clientserver_test.go
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    28
+++ b/src/net/http/clientserver_test.go
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    29
@@ -468,7 +468,7 @@ func TestH12_RequestContentLength_Known_NonZero(t *testing.T) {
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    30
 }
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    31
 
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    32
 func TestH12_RequestContentLength_Known_Zero(t *testing.T) {
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    33
-	h12requestContentLength(t, func() io.Reader { return strings.NewReader("") }, 0)
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    34
+	h12requestContentLength(t, func() io.Reader { return nil }, 0)
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    35
 }
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    36
 
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    37
 func TestH12_RequestContentLength_Unknown(t *testing.T) {
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    38
-- 
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    39
2.7.4
c388d4e1d3ad PSARC/2016/250 Google Go version 1.7
Shawn Walker-Salas <shawn.walker@oracle.com>
parents:
diff changeset
    40