feat: add ?meta=eof for trailling metadata dag-json#15
Closed
Conversation
Member
Author
|
lidel
reviewed
Aug 10, 2023
httpipfs.go
Outdated
| return | ||
| } | ||
|
|
||
| includeMeta := req.URL.Query().Get("meta") == "eof" |
Contributor
There was a problem hiding this comment.
nit: this is a CAR content type parameter, and should go to Accept and Content-Type headers, like ones from IPIP-412. (mentioning early to avoid costly renames later 😅)
Member
Author
There was a problem hiding this comment.
Ah ok, so the reasoning here is that anything that changes the format of the output should go in Content-Type or Accept? The content itself is dictated by the query parameters, but the way it's presented is dictated by these headers? Is that the right way to think about it?
So something like:
Accept: application/vnd.ipld.car; version=1; order=dfs; dups=y; meta=eof;
Shouldn't be hard to adapt this. We have a ParseAccept in lassie that I'm using here which I'll just extend if that's where it goes.
rvagg
added a commit
to filecoin-project/lassie
that referenced
this pull request
Aug 11, 2023
…m http fetches Ref: ipfs/specs#431 Ref: ipld/frisbii#15
rvagg
added a commit
to filecoin-project/lassie
that referenced
this pull request
Aug 11, 2023
…m http fetches Ref: ipfs/specs#431 Ref: ipld/frisbii#15
rvagg
added a commit
to filecoin-project/lassie
that referenced
this pull request
Aug 11, 2023
…m http fetches Ref: ipfs/specs#431 Ref: ipld/frisbii#15
rvagg
added a commit
to filecoin-project/lassie
that referenced
this pull request
Aug 11, 2023
…m http fetches Ref: ipfs/specs#431 Ref: ipld/frisbii#15
rvagg
added a commit
to filecoin-project/lassie
that referenced
this pull request
Aug 11, 2023
…m http fetches Ref: ipfs/specs#431 Ref: ipld/frisbii#15
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.
Prototype for an option for implementing ipfs/specs#431
Defines a new
metaquery parameter that, if it has a value ofeof, will do the following:NULbyte, such that the CARv1 is only now parseable with theZeroLengthSectionAsEOFmode (I don't think we have this in js-car yet but it's not hard as an opt-in), but it cleanly terminates.Lassie should be able to pass in
?meta=eofto HTTP retrievals, strip this message out (where it exists - remotes may not have it), and present the information separately; either via an API return property, or to stdout for the CLI.Examples (which you can run with curl):
curl 'http://ipfs.va.gg:3747/ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/wiki/Oregon_Cartoon_Institute?dag-scope=entity&meta=eof' -o foo.carPretty printed dag-json trailing bytes:
/cc @bajtos