Skip to content

test(gateway): cover bare CID etag match for dir listings#1129

Merged
lidel merged 1 commit intomainfrom
test/dir-listing-bare-cid-etag-match
Apr 6, 2026
Merged

test(gateway): cover bare CID etag match for dir listings#1129
lidel merged 1 commit intomainfrom
test/dir-listing-bare-cid-etag-match

Conversation

@lidel
Copy link
Copy Markdown
Member

@lidel lidel commented Mar 31, 2026

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 HTTP header 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>".

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
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.53%. Comparing base (43c30ce) to head (8245f5f).
⚠️ Report is 2 commits behind head on main.

Impacted file tree graph

@@            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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 lidel marked this pull request as ready for review April 6, 2026 20:07
@lidel lidel merged commit fb8b455 into main Apr 6, 2026
18 checks passed
@lidel lidel deleted the test/dir-listing-bare-cid-etag-match branch April 6, 2026 20:08
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant