Uh oh!
There was an error while loading. Please reload this page.
Enable SocketHttpHandler to decompress zlib or deflate - #57862
Conversation
Some servers incorrectly implement the deflate content-coding with the raw deflate algorithm rather than with deflate wrapped with a zlib header/footer. Auto-detect whether to use ZLibStream or DeflateStream in order to accomodate both kinds of responses.
ghost
commented
Aug 20, 2021
Tagging subscribers to this area: @dotnet/ncl Issue DetailsSome servers incorrectly implement the deflate content-coding with the raw deflate algorithm rather than with deflate wrapped with a zlib header/footer. Auto-detect whether to use ZLibStream or DeflateStream in order to accomodate both kinds of responses. Fixes #57604
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
geoffkizer
commented
Aug 23, 2021
Should we have a test specifically for 0-length compressed content? Presumably this will always fail, but given that we need to special case this now (to peek at the first byte), should we validate that we fail as expected? |
stephentoub
commented
Aug 23, 2021
Suggestions for what specifically to test? Before and after this change, if there's a 0-length response body, either with Content-Length: 0 or with just closing the connection, the request succeeds. |
Meaning, the response stream has 0 bytes? I suppose we could test for that. Edit: I really meant "response stream" here, meaning the response content as reported to the user. Not "response body" as in bits on the wire. |
stephentoub
commented
Aug 23, 2021
I added a test for an empty response body, which translates to an empty pre-decompression response stream, which translates to an empty post-decompression response stream. I can add a test as well for a non-empty response body that translates to a non-empty pre-decompression response stream that translates to an empty post-decompression response stream... is that what you mean? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
stephentoub
commented
Aug 23, 2021
/backport to release/6.0-rc1 |
Started backporting to release/6.0-rc1: https://github.com/dotnet/runtime/actions/runs/1159222795 |
Some servers incorrectly implement the deflate content-coding with the raw deflate algorithm rather than with deflate wrapped with a zlib header/footer. Auto-detect whether to use ZLibStream or DeflateStream in order to accomodate both kinds of responses.
Fixes#57604