-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add HEAD request. #104 #109
base: main
Are you sure you want to change the base?
Conversation
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.
The implementation LGTM.
Can you please add some unit tests?
This comment was marked as outdated.
This comment was marked as outdated.
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.
Almost there!
const stats = {} | ||
await spark.testHeadRequest('/dns/frisbii.fly.dev/tcp/443/https', KNOWN_CID, stats) | ||
assertEquals(stats.headStatusCode, 200) | ||
assertEquals(requests, [{ url: `https://frisbii.fly.dev/ipfs/${KNOWN_CID}?dag-scope=block`, method: 'HEAD' }]) |
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.
Have you considered the feedback in CheckerNetwork/frisbii-on-fly#3 (comment)?
Once fixed, you may want to test with explicit content type:
HEAD /ipfs/cid?format=raw
+ passAccept: application/vnd.ipld.raw
to ensure your requested trustless block responses and avoid issues if the other end supports deserialized responses as well.There is a risk of false positive if deserialized response happens to fit in a single block, so choosing CID of a chunked data may be a good idea.
Should we implement this suggestion as part of the work adding HEAD request checking to Spark? If not, can you create a follow-up issue please?
Co-authored-by: Miroslav Bajtoš <[email protected]>
For #104
Next: Integrate into spark-api. This is not blocking, as submitting the measurements also already works with the new property -> CheckerNetwork/spark-api#521