-
Notifications
You must be signed in to change notification settings - Fork 210
Open
Description
- I have looked for existing issues (including closed) about this
Feature Request
Ignore decompression UnexpectedEOF errors for responses with empty body
Motivation
Servers sometimes return content-encoding/content-length with empty body for HEAD requests. I was looking into refactoring reqwest's decompression to use tower-http and would like to port this functionality to tower-http::decompression.
Proposal
Add boolean flag to StreamErrorIntoIoError to track whether any data has been read. Swallow any decompression errors in WrapBody if flag is not set.
Alternatives
I have thought about having two layers before and after decompression layer. One tracks if any data has been read while the other conditionally suppresses error (inspired by ducaale/xh#411).
But before pursuing this idea any further, I wanted to see if this can be handled by tower-http instead.
Metadata
Metadata
Assignees
Labels
No labels