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

Requests should be gzipped when Accept-Encoding explicitly rejects identity #1855

Closed
colega opened this issue May 16, 2022 · 1 comment · Fixed by #1864
Closed

Requests should be gzipped when Accept-Encoding explicitly rejects identity #1855

colega opened this issue May 16, 2022 · 1 comment · Fixed by #1864
Assignees
Labels
bug Something isn't working

Comments

@colega
Copy link
Contributor

colega commented May 16, 2022

Describe the bug

When Accept-Encoding: gzip;q=1, *;q=0 request is received, we should encode the response as gzip even if it's smaller than the default min size (1500B). However, we don't.

To Reproduce

Steps to reproduce the behavior:

  1. Build Mimir @ 93dbb1fc6197e381e3265f72d9c1b399afe570e3
  2. Build it make ./cmd/mimir/.uptodate
  3. Run the tutorial cd tutorials/play-with-grafana-mimir && docker-compose up
  4. Run curl:
$ curl -v -H'X-Scope-OrgId: demo' -H'Accept-Encoding: gzip=1; *;q=0' 'http://localhost:9009/prometheus/api/v1/query?query=1'
*   Trying 127.0.0.1:9009...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9009 (#0)
> GET /prometheus/api/v1/query?query=1 HTTP/1.1
> Host: localhost:9009
> User-Agent: curl/7.68.0
> Accept: */*
> X-Scope-OrgId: demo
> Accept-Encoding: gzip=1; *;q=0
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.21.6
< Date: Mon, 16 May 2022 15:57:07 GMT
< Content-Type: application/json
< Content-Length: 77
< Connection: keep-alive
< Server-Timing: querier_wall_time;dur=0.290327, response_time;dur=0.74459
< Vary: Accept-Encoding
< 
* Connection #0 to host localhost left intact
{"status":"success","data":{"resultType":"scalar","result":[1652716627,"1"]}}

Expected behavior

Response should be gzip-encoded (or 406 Not Acceptable status should be returned)

@colega colega added the bug Something isn't working label May 16, 2022
@colega colega self-assigned this May 16, 2022
@colega
Copy link
Contributor Author

colega commented May 16, 2022

This would be the fix in nytimes/gziphandler: nytimes/gziphandler#112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant