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.
Feature Request
Ignore decompression
UnexpectedEOFerrors for responses with empty bodyMotivation
Servers sometimes return
content-encoding/content-lengthwith empty body forHEADrequests. I was looking into refactoring reqwest's decompression to usetower-httpand would like to port this functionality totower-http::decompression.Proposal
Add boolean flag to
StreamErrorIntoIoErrorto track whether any data has been read. Swallow any decompression errors inWrapBodyif 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-httpinstead.