the defect of gzip middleware
taodongl opened this issue · 1 comments
taodongl commented
defer func() {
**c.Header("Content-Length", "0")**
gz.Close()
}()
it can't work:
- if want to remove header, you should use
c.Header("Content-Length", "")
- in fact, the header couldn't be changed after data is filled. It is limited of GIN.
Another issue:
The middleware always compresses everything, even though the data is small.
jialechan commented
defer func() {
**c.Header("Content-Length", "0")**
gz.Close()
}()
this is from source code?