Skip to content

Commit 026cdc4

Browse files
authored
test: add third option for CAR non-existing path responses (#245)
* test: add third option for CAR non-existing path responses add temporary support for legacy 200 with X-Stream-Error header behavior when missing blocks are detected during streaming. this ensures compatibility with current boxo/gateway implementations that defer header setting. relates to ipfs/boxo@1ac242a6 which fixes CAR handler to properly return 404 status codes instead of 200 with X-Stream-Error TODO: remove once Kubo ships with ipfs/boxo#1019 * docs: add v0.8.3 changelog entry document temporary support for legacy X-Stream-Error header behavior in CAR responses for non-existing paths
1 parent f766b67 commit 026cdc4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.8.3] - 2025-09-01
8+
### Changed
9+
- Added temporary support for legacy 200 with X-Stream-Error header behavior when missing blocks are detected during CAR streaming. This ensures compatibility with current boxo/gateway implementations that defer header setting. This third option will be removed once implementations ship with [ipfs/boxo#1019](https://github.com/ipfs/boxo/pull/1019). [#245](https://github.com/ipfs/gateway-conformance/pull/245)
10+
711
## [0.8.2] - 2025-08-31
812
### Changed
913
- 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](https://github.com/ipfs/boxo/issues/458)). Implementations focusing on stateless streaming and low latency may return 200 with partial CAR up to the missing link (legacy behavior). [#244](https://github.com/ipfs/gateway-conformance/pull/244)

tests/trustless_gateway_car_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ func TestTrustlessCarPathing(t *testing.T) {
122122
// Implementations with efficient path checks: 404 Not Found
123123
Expect().
124124
Status(404),
125+
// TODO: remove once Kubo ships with https://github.com/ipfs/boxo/pull/1019
126+
// Legacy behavior: 200 with X-Stream-Error header when missing blocks detected during streaming
127+
// is returned by boxo/gateway with remote car backend that implements the above PR
128+
Expect().
129+
Status(200).
130+
Headers(
131+
Header("X-Stream-Error").Not().IsEmpty(),
132+
),
125133
),
126134
},
127135
}

0 commit comments

Comments
 (0)