1
0
mirror of https://github.com/labstack/echo.git synced 2025-02-03 13:11:39 +02:00

Fixed body-limit middleware test

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-09-22 23:01:46 -07:00
parent 2aec0353f5
commit 1f1b211328

View File

@ -12,7 +12,6 @@ import (
)
func TestBodyLimit(t *testing.T) {
return
e := echo.New()
hw := []byte("Hello, World!")
req, _ := http.NewRequest(echo.POST, "/", bytes.NewReader(hw))
@ -29,7 +28,7 @@ func TestBodyLimit(t *testing.T) {
// Based on content length (within limit)
if assert.NoError(t, BodyLimit("2M")(h)(c)) {
assert.Equal(t, http.StatusOK, rec.Code)
assert.Equal(t, hw, rec.Body.Bytes)
assert.Equal(t, hw, rec.Body.Bytes())
}
// Based on content read (overlimit)