Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Aug 31, 2025

The response code for non-existing paths now depends on implementation details such as locality and cost of path traversal checks.

This change:

  • Updates TestTrustlessCarPathing to use AnyOf for non-existing file test
  • Enhances applyStandardCarResponseHeaders to handle AnyOfExpectBuilder
  • Applies CAR headers only to 200 responses, not to 404 error responses

The response code for non-existing paths now depends on implementation
details such as locality and cost of path traversal checks.

- Implementations that can efficiently detect non-existing paths should
  return 404 Not Found (improved behavior per ipfs/boxo#458)
- Implementations focusing on stateless streaming and low latency may
  return 200 with partial CAR up to the missing link (legacy behavior)

This change:
- Updates TestTrustlessCarPathing to use AnyOf for non-existing file test
- Enhances applyStandardCarResponseHeaders to handle AnyOfExpectBuilder
- Applies CAR headers only to 200 responses, not to error responses
- Refactors helper code to be more DRY and idiomatic
@github-actions
Copy link
Contributor

Results against Kubo master:
(check the action's summary for the full results)

Summary

Tests Failures Errors Skipped
1318 0 0 0

@github-actions
Copy link
Contributor

Results against Kubo latest:
(check the action's summary for the full results)

Summary

Tests Failures Errors Skipped
1318 0 0 0

Includes relaxed CAR tests that accept both 200 and 404 for non-existing paths.

See #244 for details.
@github-actions
Copy link
Contributor

v0.8.2

Changed

  • Relaxed CAR tests to accept both HTTP 200 and 404 for non-existing paths. The response code now depends on implementation details such as locality and cost of path traversal checks. Implementations that can efficiently detect non-existing paths should return 404 (improved behavior per ipfs/boxo#458). Implementations focusing on stateless streaming and low latency may return 200 with partial CAR up to the missing link (legacy behavior). #244

@lidel
Copy link
Member Author

lidel commented Aug 31, 2025

Shipping as this is backward-compatible patch that does not require any changes in existing software, but unblocks us to work on ipfs/boxo#458 & ipfs/boxo#1019

@lidel lidel marked this pull request as ready for review August 31, 2025 00:45
@lidel lidel merged commit f766b67 into main Aug 31, 2025
12 checks passed
@lidel lidel deleted the fix/relax-car-error-status-codes branch August 31, 2025 00:46
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.

2 participants