Skip to content

Commit 32683b5

Browse files
committed
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
1 parent f766b67 commit 32683b5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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)