fix(gateway): support suffix range requests#922
Merged
Conversation
aschmahmann
commented
May 22, 2025
Member
|
Triage notes:
|
This was referenced May 27, 2025
car backend did not support negative ranges, this attempts to fix that for raw blocks and dag-pb files
Member
I will take a look with fresh eyes tomorrow, remaining work is to bubble up and land everything:
|
4 tasks
lidel
approved these changes
May 28, 2025
Member
lidel
left a comment
There was a problem hiding this comment.
- 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.
lidel
added a commit
that referenced
this pull request
May 28, 2025
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.
Merged
lidel
reviewed
May 28, 2025
| // | ||
| // [HTTP Byte Range]: https://httpwg.org/specs/rfc9110.html#rfc.section.14.1.2 | ||
| type ByteRange struct { | ||
| From uint64 |
Member
There was a problem hiding this comment.
💭 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.
gammazero
pushed a commit
that referenced
this pull request
Jun 3, 2025
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.