diff --git a/pkg/protocol/http1/client_test.go b/pkg/protocol/http1/client_test.go index 8c0869dde..71ab7529e 100644 --- a/pkg/protocol/http1/client_test.go +++ b/pkg/protocol/http1/client_test.go @@ -185,7 +185,7 @@ func testContinueReadResponseBodyStream(t *testing.T, header, body string, maxBo t.Fatalf("error when reading request body stream: %s", err) } fRead := firstRead - streamRead := make([]byte, fRead) + streamRead := make([]byte, 0, fRead) sR, _ := r.BodyStream().Read(streamRead) if sR != firstRead { diff --git a/pkg/protocol/http1/req/request_test.go b/pkg/protocol/http1/req/request_test.go index 0411187a5..54edf7354 100644 --- a/pkg/protocol/http1/req/request_test.go +++ b/pkg/protocol/http1/req/request_test.go @@ -1269,7 +1269,7 @@ func testContinueReadBodyStream(t *testing.T, header, body string, maxBodySize, t.Fatalf("error when reading request body stream: %s", err) } fRead := firstRead - streamRead := make([]byte, fRead) + streamRead := make([]byte, 0, fRead) sR, _ := r.BodyStream().Read(streamRead) if sR != firstRead {