Skip to content

Commit

Permalink
refactor: simplify the condition
Browse files Browse the repository at this point in the history
  • Loading branch information
orisano committed Dec 5, 2021
1 parent 354c9c2 commit 73a266d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func GzipWithConfig(config GzipConfig) echo.MiddlewareFunc {
w.Reset(rw)
grw := &gzipResponseWriter{Writer: w, ResponseWriter: rw}
defer func() {
if res.Size == 0 && !grw.wroteBody {
if !grw.wroteBody {
if res.Header().Get(echo.HeaderContentEncoding) == gzipScheme {
res.Header().Del(echo.HeaderContentEncoding)
}
Expand Down

0 comments on commit 73a266d

Please sign in to comment.