-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[FIX] We must close gzip.Reader, only if no error #1069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] We must close gzip.Reader, only if no error #1069
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1069 +/- ##
=======================================
Coverage 80.46% 80.46%
=======================================
Files 27 27
Lines 1879 1879
=======================================
Hits 1512 1512
Misses 259 259
Partials 108 108
Continue to review full report at Codecov.
|
@vishr any updates? |
middleware/compress_test.go
Outdated
@@ -89,7 +89,9 @@ 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move code into assert.NoError() block like https://github.com/ferhatelmas/echo/blob/6436430d464309275ea5218c1e30b6e81c1d4137/middleware/compress_test.go#L38
Enhancements: Implemented Response#After() Dynamically add/remove proxy targets Rewrite rules for proxy middleware Add ability to extract key from a form field Implemented rewrite middleware Adds a separate flag for the 'http/https server started on' message (#1043) Applied a little DRY to the redirect middleware (#1053) and tests (#1055) Simplify dep fetching (#1062) Add custom time stamp format #1046 (#1066) Update property name & default value & comment about custom logger Add X-Requested-With header constant Return error of context.File in c.contentDisposition Updated deps Updated README.md Fixes: Fixed Response#Before() Fixed #990 Fix href url from armor to echo (#1051) Fixed #1054 Fixed #1052, dropped param alias feature Avoid redirect loop in HTTPSRedirect middleware (#1058) Fix deferring body close in middleware/compress test (#1063) Cleanup code (#1061) FIX - We must close gzip.Reader, only if no error (#1069) Fix formatting (#1071) Can be a fix for auto TLS
No description provided.