Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

juliangruber
Copy link
Member

@juliangruber juliangruber commented Feb 13, 2025

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

Copy link
Member

@bajtos bajtos left a 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?

@juliangruber

This comment was marked as outdated.

@juliangruber juliangruber requested a review from bajtos February 18, 2025 10:47
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

test/integration.js Outdated Show resolved Hide resolved
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' }])
Copy link
Member

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 + pass Accept: 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 in progress
Development

Successfully merging this pull request may close these issues.

2 participants