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

Transports should allow setting DisableCompression #2006

Closed
julz opened this issue Feb 3, 2021 · 0 comments · Fixed by #2007
Closed

Transports should allow setting DisableCompression #2006

julz opened this issue Feb 3, 2021 · 0 comments · Fixed by #2007
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@julz
Copy link
Member

julz commented Feb 3, 2021

/kind bug

Expected Behavior

The transports returned by NewAutoTransport should support disabling go's helpful functionality where it silently adds an Accept-Encoding: gzip header and uncompresses the result for you. While this feature is often useful, it's not what we want for Activator and QP's ReverseProxy transports since it (a) injects an extra header not in the client side in to the request the user container receives, and (b) causes the QP/Activator to end up uncompressing things uselessly and wastefully if the user container happens to co-operate with that request

Actual Behavior

The transports do not set DisableCompression=true, so Go helpfully injects an Accept-Encoding: gzip header. This ends up causing the user container to compress the response (if it supports gzip encoding), which the QP immediately then immediately uncompresses :).

Steps to Reproduce the Problem

  1. ko apply ksvc.yaml from https://github.com/julz/gziphello
  2. curl the container, don't pass any extra headers
  3. see in logs that gzip header was nevertheless added
  4. notice (by logging resp.Uncompressed) that queue proxy uncompressed the response and the container compressed it entirely pointlessly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants