-
Notifications
You must be signed in to change notification settings - Fork 112
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
Don't send Content-Encoding header with streamed responses #1601
Conversation
Attached issue: https://pulp.plan.io/issues/9213 |
This makes sense for gzip, but what about other values of |
@bmbouter You're referring to the changelog entry? |
I mean functionally. We know aiohttp decompresses gzip, but what about others? If aiohttp doesn't decompress it then removing the content encoding header would be incorrect. (I have no idea what aiohttp does). |
All of the 4 possible values for Content-Encoding imply compression[0]. aiohttp decompresses 'gzip' and 'deflate' by default. 'brotli' encoding support can be enabled by installing 'brotlipy'[1]. 'encode' does not seem to be used much by servers due to a pattent issue. It doesn't look like aiohttp has support for auto inflating the response when the Content-Encoding is 'compress'. [0] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding#directives |
To be sure we're not regressing, what if we only discard the |
@bmbouter Because aiohttp can't handle other compression types, I'm pretty sure it would set |
Does it also accept |
@dralley so what would you recommend given that? |
@bmbouter If aiohttp is setting the |
Well said. I agree completely. @dkliban can you confirm via local testing that your patch is resolving the issue? You were able to reproduce the issue right? |
CHANGES/9213.bugfix
Outdated
@@ -0,0 +1 @@ | |||
Fixed bug where uncompressed on_demand content was streamed with "Content-Encoding: gzip" header. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this?
Fixed bug where uncompressed on_demand content was streamed with "Content-Encoding: gzip" header. | |
Fixed bug where ``pulpcore-content`` decompressed data while incorrectly advertising to clients it was still compressed via the ``Content-Encoding: gzip`` header. |
I reproduced the issue locally and confirmed that the patch resolves it. |
aiohttp automatically enflates gzipped responses. Pulp clients always receive uncompressed responses when requesting on_demand content. fixes: #9213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
aiohttp automatically enflates gzipped responses. Pulp clients always receive
uncompressed responses when requesting on_demand content.
fixes: #9213