cc ipfs/boxo#176, as would be good to have this before we merge that, or shortly after
TLDR
We don't want to be too strict here, but also we want to be able to write a test that limits the possibility space to the above paths.
If someone implements Ranges, we want to ensure the response is valid.
If they don't, we also want to ensure the response is valid.
Background
Coverage of range behaviors is bare minimum for UnixFS right now.
We should improve it and both relax requirements (allowing implementers to choose what to support) and make asserts more explicit (if you choose to implement something optional, you should behave A, if you don't, we expect fallback to be either B or C etc).
When it comes to range requests, HTTP specs (RFC9110) make them OPTIONAL. Supporting HTTP Ranges is useful for streaming chunks of deserialized videos, and that is what some IPFS Gateways support when a client asks for deserialized data (a single range).
Missing tests and tooling
A file could be any type of deserialized response, but in practice, end users only care about UnixFS file, and the test should use a chunked(!) UnixFS file, ideally in a HAMT directory, making sure Ranges work there too.
What we need in DSL
It is most likely that we need to extend test DSL with something like AnyOf described in #153
TLDR
We don't want to be too strict here, but also we want to be able to write a test that limits the possibility space to the above paths.
If someone implements Ranges, we want to ensure the response is valid.
If they don't, we also want to ensure the response is valid.
Background
Coverage of range behaviors is bare minimum for UnixFS right now.
We should improve it and both relax requirements (allowing implementers to choose what to support) and make asserts more explicit (if you choose to implement something optional, you should behave A, if you don't, we expect fallback to be either B or C etc).
When it comes to range requests, HTTP specs (RFC9110) make them OPTIONAL. Supporting HTTP Ranges is useful for streaming chunks of deserialized videos, and that is what some IPFS Gateways support when a client asks for deserialized data (a single range).
Missing tests and tooling
Accept-Ranges noneis present (HEAD/GET) andRangerequest returns HTTP 200 with the whole fileRangereturned HTTP 206 with bytes for the slicemultipart/byterangesand ALL requested rangesA file could be any type of deserialized response, but in practice, end users only care about UnixFS file, and the test should use a chunked(!) UnixFS file, ideally in a HAMT directory, making sure Ranges work there too.
What we need in DSL
It is most likely that we need to extend test DSL with something like
AnyOfdescribed in #153