-
Notifications
You must be signed in to change notification settings - Fork 6
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
Include optional Ipni-Cid-Schema-Type HTTP header #221
Conversation
github actions seems to be pretty unhappy about the references here - are you missing a file / definition? |
This optional header, when present, serves as an indication to advertisement publishers what type of data is being requested and is identified by the CID. This may help some publishers more quickly lookup the data. The publisher, who receives the Ipni-Cid-Schema-Type HTTP header, does not validate the value, because newer values may need to be received by consumer that is using an older version of library. Implements fix for ipni/storetheindex#2662
860c89b
to
fe0831e
Compare
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.
Blockers:
- exposed context key for schema type
- check that returned node matches the expected type from link system.
- match IPLD schema types exactly for header values.
Otherwise, LGTM. Left some suggestions.
Thank you for getting this done @gammazero 🍻
// Value already checked in Sync. | ||
reqType, ok := ctx.Value(CidSchemaCtxKey).(string) | ||
if ok { | ||
req.Header.Set(CidSchemaHeader, reqType) |
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.
OK to set this for both request and response. We just want to make sure this is documented in the specs somewhere.
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 don't think we want it in the response, do we, since the indexer knows what was requested?
6a23460
to
bbbeb76
Compare
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.
There is a minor lint issue that's failing CI, otherwise no blockers. Thanks @gammazero 🚀
Same as #221 applied to Release-0.5.x branch. - update go-libp2p to latest
Same as #221 applied to Release-0.5.x branch. - update go-libp2p to latest
This optional header, when present, serves as an indication to advertisement publishers what type of data is being requested and is identified by the CID. This may help some publishers more quickly lookup the data.
The publisher, who receives the Ipni-Cid-Schema-Type HTTP header, does not validate the value, because newer values may need to be received by consumer that is using an older version of library.
Implements fix for ipni/storetheindex#2662