Skip to content

fix: remove bare CID etag test for dir listings#281

Merged
lidel merged 1 commit into
mainfrom
fix/dir-listing-etag-test
Mar 31, 2026
Merged

fix: remove bare CID etag test for dir listings#281
lidel merged 1 commit into
mainfrom
fix/dir-listing-etag-test

Conversation

@lidel

@lidel lidel commented Mar 31, 2026

Copy link
Copy Markdown
Member

This PR removes If-None-Match test that sent W/"<CID>" for a directory listing and expected 304. The gateway ETag for directory listings is "DirIndex-<hash>_CID-<CID>", which never matches a bare CID.

This test was copied from old go-ipfs, and does not belong here.

Matching a bare CID is an optimization specific to boxo/gateway (which checks If-None-Match against both the CID ETag and the DirIndex ETag before doing any I/O). This is not a spec requirement for all gateway implementations.

@github-actions

Copy link
Copy Markdown
Contributor

Results against Kubo master:

Summary

Tests Failures Errors Skipped
1265 0 0 0

@github-actions

Copy link
Copy Markdown
Contributor

Results against Kubo latest:

Summary

Tests Failures Errors Skipped
1265 0 0 0

Remove If-None-Match test that sent W/"<CID>" for a directory
listing and expected 304. The gateway ETag for directory listings
is "DirIndex-<hash>_CID-<CID>", which never matches a bare CID.

Matching a bare CID is an optimization specific to boxo/gateway
(which checks If-None-Match against both the CID ETag and the
DirIndex ETag before doing any I/O). This is not a spec
requirement for all gateway implementations.

Test moved to ipfs/boxo: ipfs/boxo#1129

Fixes #261
@lidel
lidel force-pushed the fix/dir-listing-etag-test branch from a72aa9e to 7417a04 Compare March 31, 2026 22:44
@lidel
lidel marked this pull request as ready for review March 31, 2026 22:56
@lidel
lidel merged commit b6d3e50 into main Mar 31, 2026
10 checks passed
@lidel
lidel deleted the fix/dir-listing-etag-test branch March 31, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty weak etag is supposed to match?

1 participant