Closed seanmonstar closed 9 months ago
This waited so long because it was a breaking change, but can now be included with the http
upgrade. This is a different take from #93, which doesn't expose as many new types.
It's a very conservative change, while allowing something much more comprehensive from eventually being added.
Idk if you're big on tests, but if we're testing satisfiable range, then the opposite should also be tested, shouldn't it?
An HTTP Range of
bytes=-100
means a suffix, the last 100 bytes. This was wrongly parsed as the Rust range..100
, which means the first 100 bytes.This has been fixed, but doing so required change
Range::iter
to accept a length argument, to determine if the ranges are satisfiable.Closes #87
BREAKING CHANGE: Change
.iter()
calls to.satisfiable_ranges(len)
. Also, theRange::bytes()
constructor will now return an error if pass aRangeTo
(e.g.Range::bytes(..100)
).