-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for HTTP Range requests #154
Labels
test:coverage
Improves the spec covered by this test suite
Comments
We have tests for trustless
|
2 tasks
Another thing that we should have test for is |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 none
is present (HEAD/GET) andRange
request returns HTTP 200 with the whole fileRange
returned HTTP 206 with bytes for the slicemultipart/byteranges
and 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
AnyOf
described in #153The text was updated successfully, but these errors were encountered: