gin-contrib/gzip

the defect of gzip middleware

taodongl opened this issue · 1 comments

		defer func() {
			**c.Header("Content-Length", "0")**
			gz.Close()
		}()

it can't work:

  1. if want to remove header, you should use c.Header("Content-Length", "")
  2. 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.

defer func() {
	**c.Header("Content-Length", "0")**
	gz.Close()
}()

this is from source code?