-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat: switch gateway GetRange API to match Get #240
Conversation
Also fixes serving range requests for /ipfs/bafydir when we know we'll get the index.html or _redirect.
ff460b5
to
3867a1a
Compare
// data, however consumers of this function may require extra data beyond the passed ranges (e.g. the initial bit of | ||
// the file might be used for content type sniffing even if only the end of the file is requested). | ||
// Note: there is currently no semantic meaning attached to a range request for a directory | ||
GetRange(context.Context, ImmutablePath, ...GetRange) (ContentPathMetadata, *GetResponse, error) |
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.
Looking at the code now, should we just have a single function Get(context.Context, ImmutablePath, ...GetRange) (ContentPathMetadata, *GetResponse, error)
and drop GetRange
entirely (since passing no ranges is equivalent to asking for the entire object)?
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.
I think that's a good idea.
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.
I will do it in #245
Codecov Report
@@ Coverage Diff @@
## main #240 +/- ##
==========================================
+ Coverage 47.70% 48.01% +0.30%
==========================================
Files 266 269 +3
Lines 32950 32957 +7
==========================================
+ Hits 15718 15823 +105
+ Misses 15549 15466 -83
+ Partials 1683 1668 -15
|
I've cherry-picked this into #245, will continue there, Incl. |
Also fixes serving range requests for /ipfs/bafydir when we know we'll get the index.html or _redirect.
cc ipfs-inactive/bifrost-gateway#61