mirror of https://github.com/gin-gonic/gin.git
Check multipart file header size on test (#2716)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: thinkerou <thinkerou@gmail.com>
This commit is contained in:
parent
f13e53bb92
commit
168edcad80
|
@ -124,7 +124,7 @@ func createRequestMultipartFiles(t *testing.T, files ...testFile) *http.Request
|
||||||
|
|
||||||
func assertMultipartFileHeader(t *testing.T, fh *multipart.FileHeader, file testFile) {
|
func assertMultipartFileHeader(t *testing.T, fh *multipart.FileHeader, file testFile) {
|
||||||
assert.Equal(t, file.Filename, fh.Filename)
|
assert.Equal(t, file.Filename, fh.Filename)
|
||||||
// assert.Equal(t, int64(len(file.Content)), fh.Size) // fh.Size does not exist on go1.8
|
assert.Equal(t, int64(len(file.Content)), fh.Size)
|
||||||
|
|
||||||
fl, err := fh.Open()
|
fl, err := fh.Open()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
Loading…
Reference in New Issue