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

Consul http output should support compression #3687

Closed
kamaradclimber opened this issue Nov 13, 2017 · 1 comment
Closed

Consul http output should support compression #3687

kamaradclimber opened this issue Nov 13, 2017 · 1 comment
Labels
theme/api Relating to the HTTP API interface type/enhancement Proposed improvement or new feature
Milestone

Comments

@kamaradclimber
Copy link
Contributor

consul version for both Client and Server

Client: 0.9.3
Server: 0.9.3

Description of the Issue (and unexpected/desired result)

Consul does not compress answers of the http api.

Reproduction steps

Using Accept-Encoding header does not modify consul response.

curl --compressed -v 'consul.service.consul.prod.crto.in:8500/v1/health/service/web-rtb-eu?passing=true&stale='

returns:

> GET /v1/health/service/web-rtb-eu?passing=true&stale= HTTP/1.1
> Host: consul.service.consul.prod.crto.in:8500
> User-Agent: curl/7.56.1
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
< HTTP/1.1 200 OK
< Content-Type: application/json
< X-Consul-Index: 487052299
< X-Consul-Knownleader: true
< X-Consul-Lastcontact: 80
< Date: Mon, 13 Nov 2017 13:19:28 GMT
< Transfer-Encoding: chunked

response is 500K but could be compressed to ~30K

@slackpad slackpad added type/enhancement Proposed improvement or new feature theme/api Relating to the HTTP API interface labels Nov 13, 2017
@slackpad slackpad added this to the Unplanned milestone Nov 13, 2017
yfouquet pushed a commit to yfouquet/consul that referenced this issue Apr 3, 2018
The need has been spotted in issue hashicorp#3687.
Using "NYTimes/gziphandler", the http api responses can now be compressed if required.
The Go API requires compressed response if possible and handle the compressed response.
We here change only the http api (not the UI for instance).
@mkeeler
Copy link
Member

mkeeler commented Apr 4, 2018

Going to close as I just merged support into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api Relating to the HTTP API interface type/enhancement Proposed improvement or new feature
Projects
None yet
Development

No branches or pull requests

3 participants