test(gateway): cover bare CID etag match for dir listings#1129
Merged
Conversation
This test was originally in go-ipfs (now kubo) sharness t0116, then ported to ipfs/gateway-conformance. Moving it here because matching W/"<CID>" against a directory listing is a boxo-specific optimization, not a spec requirement for all gateways. handleIfNoneMatch checks If-None-Match against both the bare CID ETag and the DirIndex ETag before doing any I/O, so a client sending W/"<CID>" gets a 304 even though the actual response ETag is "DirIndex-<hash>_CID-<CID>".
lidel
added a commit
to ipfs/gateway-conformance
that referenced
this pull request
Mar 31, 2026
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
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1129 +/- ##
==========================================
- Coverage 62.56% 62.53% -0.03%
==========================================
Files 261 261
Lines 26216 26216
==========================================
- Hits 16402 16395 -7
- Misses 8125 8131 +6
- Partials 1689 1690 +1 see 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
lidel
added a commit
to ipfs/gateway-conformance
that referenced
this pull request
Mar 31, 2026
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
added a commit
to ipfs/gateway-conformance
that referenced
this pull request
Mar 31, 2026
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
added a commit
to ipfs/rainbow
that referenced
this pull request
Apr 10, 2026
Wire boxo gateway size limit options as CLI flags: - --max-deserialized-response-size / RAINBOW_MAX_DESERIALIZED_RESPONSE_SIZE - --max-unixfs-dag-response-size / RAINBOW_MAX_UNIXFS_DAG_RESPONSE_SIZE Both disabled by default (0). When set, content exceeding the limit returns 501 directing users to run their own IPFS node. Depends on ipfs/boxo#1129.
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.
This test was originally in
go-ipfs(now kubo) sharnesst0116, then ported toipfs/gateway-conformance. Moving it here because matchingW/"<CID>"against a directory listing is a boxo-specific optimization, not a spec requirement for all gateways.handleIfNoneMatchchecksIf-None-MatchHTTP header against both the bare CID ETag and the DirIndex ETag before doing any I/O, so a client sendingW/"<CID>"gets a 304 even though the actual response ETag is"DirIndex-<hash>_CID-<CID>".