You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For use-cases where the whole body is received as a single, not too large blob, the current behaviour makes sense but for e.g. downloading media files it would make sense to also handle the case where the request succeeds but somewhere in the middle of the body there's a connection failure.
Solution
In that case a Range request to start at the last previously downloaded position could be performed on retry. This needs keeping track of the position and also of any Range header in the original requests.
The text was updated successfully, but these errors were encountered:
This is an interesting idea. I think this should be a separate middleware since it's quite a strong requirement - eg we would need to read the body which is something we currently don't do.
Criteria: If there's the Accept-Ranges: bytes and a Content-Length specified in the response, we can enable the range loop.
While the reqwest::Response object cannot have the body re-inserted, I believe we may be able to reconstruct it by using http::Response to pass back in the chain.
Motivations
For use-cases where the whole body is received as a single, not too large blob, the current behaviour makes sense but for e.g. downloading media files it would make sense to also handle the case where the request succeeds but somewhere in the middle of the body there's a connection failure.
Solution
In that case a Range request to start at the last previously downloaded position could be performed on retry. This needs keeping track of the position and also of any Range header in the original requests.
The text was updated successfully, but these errors were encountered: