-
Notifications
You must be signed in to change notification settings - Fork 126
fix(gateway): support suffix range requests #922
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
Conversation
Triage notes:
|
car backend did not support negative ranges, this attempts to fix that for raw blocks and dag-pb files
I will take a look with fresh eyes tomorrow, remaining work is to bubble up and land everything:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Switched boxo to gateway-conformance v0.8 with explicit test for suffix range-requests
- Kubo 0.35 fails as expected
- Kubo with this PR passes, confirming the fix works
- Merging this, and switching Kubo/Rainbow to boxo from main + gateway-conformance v0.8.
The #922 triggered some AI checks: https://github.com/ipfs/boxo/security/code-scanning/7 I don't think this is a problem irl, due to code in `unixfs/mod/dagmodifier.go` being related to single block (which have limits), but adding this extra check there just in case and to avoid linters bringing this up in the future.
// | ||
// [HTTP Byte Range]: https://httpwg.org/specs/rfc9110.html#rfc.section.14.1.2 | ||
type ByteRange struct { | ||
From uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 This triggered some AI checks – https://github.com/ipfs/boxo/security/code-scanning/7 – seems to be an issue already present in legacy code, unrelated to this PR.
I don't think this is a problem blocking this PR because the gateway range-requests do not mutate UnixFS DAGs.
Still, filled potential fix in #936 to make linter warning go away.
The #922 triggered some AI checks: https://github.com/ipfs/boxo/security/code-scanning/7 I don't think this is a problem irl, due to code in `unixfs/mod/dagmodifier.go` being related to single block (which have limits), but adding this extra check there just in case and to avoid linters bringing this up in the future.
fixes ipfs/kubo#10808
Well ... the need for this PR is quite embarrassing. I thought we had this covered in gateway conformance but we don't.
@lidel IIRC we discussed this when this code path was implemented and maybe this was just supposed to not support suffix requests and return 200 with everything instead of 206 (as we do for ranges on things like dir-index-html responses), but given we found a user who could actually benefit from it it seemed reasonable to implement. Feel free to take over the PR and change as you wish, but figured I'd at least present an option to help get things moving.