File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,13 @@ func TestBodyLimit(t *testing.T) {
33
33
assert .Equal (hw , rec .Body .Bytes ())
34
34
}
35
35
36
- // Based on content read (overlimit)
36
+ // Based on content length (overlimit)
37
37
he := BodyLimit ("2B" )(h )(c ).(* echo.HTTPError )
38
38
assert .Equal (http .StatusRequestEntityTooLarge , he .Code )
39
39
40
40
// Based on content read (within limit)
41
41
req = httptest .NewRequest (http .MethodPost , "/" , bytes .NewReader (hw ))
42
+ req .ContentLength = - 1
42
43
rec = httptest .NewRecorder ()
43
44
c = e .NewContext (req , rec )
44
45
if assert .NoError (BodyLimit ("2M" )(h )(c )) {
@@ -48,6 +49,7 @@ func TestBodyLimit(t *testing.T) {
48
49
49
50
// Based on content read (overlimit)
50
51
req = httptest .NewRequest (http .MethodPost , "/" , bytes .NewReader (hw ))
52
+ req .ContentLength = - 1
51
53
rec = httptest .NewRecorder ()
52
54
c = e .NewContext (req , rec )
53
55
he = BodyLimit ("2B" )(h )(c ).(* echo.HTTPError )
You can’t perform that action at this time.
0 commit comments