summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2020-10-19 18:03:51 +0000
committerBryan C. Mills <bcmills@google.com>2020-10-19 19:51:19 +0000
commit5647d01ab724a19793ac7002776b0dec03fa35f5 (patch)
treefe16ba85e761d78778a349538292c168c4f186a0
parent4d1cecdee8360ef12a817c124d7a04c9d29741c3 (diff)
downloadgo-git-5647d01ab724a19793ac7002776b0dec03fa35f5.tar.gz
Revert "net/http: test that ParseMultipartForm returns an error for int overflow"
This reverts CL 254977. Reason for revert: introduced test failures on longtest builders. Change-Id: I75e868245f980189ad85dd4103d9178989e06ecf Reviewed-on: https://go-review.googlesource.com/c/go/+/263658 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
-rw-r--r--src/net/http/request_test.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/net/http/request_test.go b/src/net/http/request_test.go
index 4f4f435814..461d66e05d 100644
--- a/src/net/http/request_test.go
+++ b/src/net/http/request_test.go
@@ -13,7 +13,6 @@ import (
"fmt"
"io"
"io/ioutil"
- "math"
"mime/multipart"
. "net/http"
"net/http/httptest"
@@ -246,41 +245,6 @@ func TestParseMultipartForm(t *testing.T) {
}
}
-// Issue #40430: ParseMultipartForm should return error for int overflow
-func TestMaxInt64ForMultipartFormMaxMemory(t *testing.T) {
- cst := httptest.NewServer(HandlerFunc(func(rw ResponseWriter, req *Request) {
- if err := req.ParseMultipartForm(math.MaxInt64); err != nil {
- Error(rw, err.Error(), StatusBadRequest)
- return
- }
- }))
- defer cst.Close()
- fBuf := new(bytes.Buffer)
- mw := multipart.NewWriter(fBuf)
- mf, err := mw.CreateFormFile("file", "myfile.txt")
- if err != nil {
- t.Fatal(err)
- }
- if _, err := mf.Write(bytes.Repeat([]byte("abc"), 1<<10)); err != nil {
- t.Fatal(err)
- }
- if err := mw.Close(); err != nil {
- t.Fatal(err)
- }
- req, err := NewRequest("POST", cst.URL, fBuf)
- if err != nil {
- t.Fatal(err)
- }
- req.Header.Set("Content-Type", mw.FormDataContentType())
- res, err := cst.Client().Do(req)
- if err != nil {
- t.Fatal(err)
- }
- if g, w := res.StatusCode, StatusBadRequest; g != w {
- t.Fatalf("Status code mismatch: got %d, want %d", g, w)
- }
-}
-
func TestRedirect_h1(t *testing.T) { testRedirect(t, h1Mode) }
func TestRedirect_h2(t *testing.T) { testRedirect(t, h2Mode) }
func testRedirect(t *testing.T, h2 bool) {