aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/sniff_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/http/sniff_test.go')
-rw-r--r--src/net/http/sniff_test.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/net/http/sniff_test.go b/src/net/http/sniff_test.go
index a776261cc1..e0085516da 100644
--- a/src/net/http/sniff_test.go
+++ b/src/net/http/sniff_test.go
@@ -51,8 +51,8 @@ func TestDetectContentType(t *testing.T) {
}
}
-func TestServerContentType_h1(t *testing.T) { testServerContentType(t, false) }
-func TestServerContentType_h2(t *testing.T) { testServerContentType(t, true) }
+func TestServerContentType_h1(t *testing.T) { testServerContentType(t, h1Mode) }
+func TestServerContentType_h2(t *testing.T) { testServerContentType(t, h2Mode) }
func testServerContentType(t *testing.T, h2 bool) {
defer afterTest(t)
@@ -87,9 +87,8 @@ func testServerContentType(t *testing.T, h2 bool) {
// Issue 5953: shouldn't sniff if the handler set a Content-Type header,
// even if it's the empty string.
-func TestServerIssue5953_h1(t *testing.T) { testServerIssue5953(t, false) }
-func TestServerIssue5953_h2(t *testing.T) { testServerIssue5953(t, true) }
-
+func TestServerIssue5953_h1(t *testing.T) { testServerIssue5953(t, h1Mode) }
+func TestServerIssue5953_h2(t *testing.T) { testServerIssue5953(t, h2Mode) }
func testServerIssue5953(t *testing.T, h2 bool) {
defer afterTest(t)
cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {
@@ -111,9 +110,8 @@ func testServerIssue5953(t *testing.T, h2 bool) {
resp.Body.Close()
}
-func TestContentTypeWithCopy_h1(t *testing.T) { testContentTypeWithCopy(t, false) }
-func TestContentTypeWithCopy_h2(t *testing.T) { testContentTypeWithCopy(t, true) }
-
+func TestContentTypeWithCopy_h1(t *testing.T) { testContentTypeWithCopy(t, h1Mode) }
+func TestContentTypeWithCopy_h2(t *testing.T) { testContentTypeWithCopy(t, h2Mode) }
func testContentTypeWithCopy(t *testing.T, h2 bool) {
defer afterTest(t)
@@ -148,9 +146,8 @@ func testContentTypeWithCopy(t *testing.T, h2 bool) {
resp.Body.Close()
}
-func TestSniffWriteSize_h1(t *testing.T) { testSniffWriteSize(t, false) }
-func TestSniffWriteSize_h2(t *testing.T) { testSniffWriteSize(t, true) }
-
+func TestSniffWriteSize_h1(t *testing.T) { testSniffWriteSize(t, h1Mode) }
+func TestSniffWriteSize_h2(t *testing.T) { testSniffWriteSize(t, h2Mode) }
func testSniffWriteSize(t *testing.T, h2 bool) {
defer afterTest(t)
cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {