mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
[FIX] We must close gzip.Reader, only if no error (#1069)
* [FIX] We must close gzip.Reader, only if no error * review comments fix
This commit is contained in:
parent
4f3080c197
commit
6da0483447
@ -89,7 +89,7 @@ func TestGzipWithStatic(t *testing.T) {
|
||||
assert.Equal(t, cl, rec.Body.Len())
|
||||
}
|
||||
r, err := gzip.NewReader(rec.Body)
|
||||
assert.NoError(t, err)
|
||||
if assert.NoError(t, err) {
|
||||
defer r.Close()
|
||||
want, err := ioutil.ReadFile("../_fixture/images/walle.png")
|
||||
if assert.NoError(t, err) {
|
||||
@ -98,3 +98,4 @@ func TestGzipWithStatic(t *testing.T) {
|
||||
assert.Equal(t, want, buf.Bytes())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user