Skip to content
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

the defect of gzip middleware #7

Open
taodongl opened this issue Mar 29, 2017 · 1 comment
Open

the defect of gzip middleware #7

taodongl opened this issue Mar 29, 2017 · 1 comment

Comments

@taodongl
Copy link

		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.

@taodongl taodongl changed the title 质量堪忧 the defect of gzip middleware Mar 29, 2017
@jialechan
Copy link

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

this is from source code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants