Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Dec 3, 2025

Update tests to reflect IPIP-524 which removes codec conversions from the gateway spec. Gateways now return 406 Not Acceptable when the requested format doesn't match the block's codec.

  • Replace TestDagPbConversion with TestCodecMismatchReturns406
  • Remove codec conversion tests (dag-pb→dag-json, dag-cbor→dag-json)
  • Fix TestPathing to request matching codec format
  • Add body verification for DAG-CBOR traversal test
  • Clarify that HTML rendering remains in spec (unlike conversions)

Implementations supporting optional codec conversions for backward compatibility are free to skip the 406 tests. I'll move conversion tests to boxo/gateway and make it configurable behind a config flag.

This needs to be released as minor release as its technically a breaking change.

Update tests to reflect IPIP-0524 which removes codec conversions from
the gateway spec. Gateways now return 406 Not Acceptable when the
requested format doesn't match the block's codec.

- Replace TestDagPbConversion with TestCodecMismatchReturns406
- Remove codec conversion tests (dag-pb→dag-json, dag-cbor→dag-json)
- Fix TestPathing to request matching codec format
- Add body verification for DAG-CBOR traversal test
- Clarify that HTML rendering remains in spec (unlike conversions)

Implementations supporting optional codec conversions for backward
compatibility are free to skip the 406 tests.

Ref: ipfs/specs#524
lidel added a commit to ipfs/boxo that referenced this pull request Dec 3, 2025
Add AllowCodecConversion to gateway.Config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec. When true, conversions between codecs are performed for backward
compatibility.

Codec conversion tests moved here from gateway-conformance since
conversions are now an optional implementation feature, not a spec
requirement. Gateway-conformance now tests for 406 responses.

Ref: ipfs/specs#524
Ref: ipfs/gateway-conformance#254
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

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

Summary

Tests Failures Errors Skipped
1219 13 0 0

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

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

Summary

Tests Failures Errors Skipped
1212 13 0 0

lidel added a commit to ipfs/boxo that referenced this pull request Dec 3, 2025
Add AllowCodecConversion to gateway.Config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec. When true, conversions between codecs are performed for backward
compatibility.

Codec conversion tests moved here from gateway-conformance since
conversions are now an optional implementation feature, not a spec
requirement. Gateway-conformance now tests for 406 responses.

Ref: ipfs/specs#524
Ref: ipfs/gateway-conformance#254
lidel added a commit to ipfs/boxo that referenced this pull request Dec 3, 2025
Add AllowCodecConversion to gateway.Config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec. When true, conversions between codecs are performed for backward
compatibility.

Codec conversion tests moved here from gateway-conformance since
conversions are now an optional implementation feature, not a spec
requirement. Gateway-conformance now tests for 406 responses.

Ref: ipfs/specs#524
Ref: ipfs/gateway-conformance#254
- Replace TestNativeDag explicit DAG-JSON format with matching format
- Replace cache tests using format=dag-json/json with format=raw
- Add body verification for raw block responses

IPIP-0524 removes codec conversions from gateway spec, so tests
should not expect 200 for cross-codec requests.
lidel added a commit to ipfs/boxo that referenced this pull request Dec 3, 2025
Add AllowCodecConversion to gateway.Config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec. When true, conversions between codecs are performed for backward
compatibility.

Codec conversion tests moved here from gateway-conformance since
conversions are now an optional implementation feature, not a spec
requirement. Gateway-conformance now tests for 406 responses.

Ref: ipfs/specs#524
Ref: ipfs/gateway-conformance#254
lidel added a commit to ipfs/boxo that referenced this pull request Dec 3, 2025
Add AllowCodecConversion to gateway.Config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec. When true, conversions between codecs are performed for backward
compatibility.

Codec conversion tests moved here from gateway-conformance since
conversions are now an optional implementation feature, not a spec
requirement. Gateway-conformance now tests for 406 responses.

Ref: ipfs/specs#524
Ref: ipfs/gateway-conformance#254
lidel added a commit to ipfs/kubo that referenced this pull request Dec 3, 2025
Wire up boxo's AllowCodecConversion config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec.

Clients should fetch raw blocks (`?format=raw`) and convert client-side.

Ref: ipfs/specs#524
Ref: ipfs/boxo#1077
Ref: ipfs/gateway-conformance#254
lidel added a commit to ipfs/kubo that referenced this pull request Dec 3, 2025
Wire up boxo's AllowCodecConversion config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec.

Clients should fetch raw blocks (`?format=raw`) and convert client-side.

Ref: ipfs/specs#524
Ref: ipfs/boxo#1077
Ref: ipfs/gateway-conformance#254
lidel added a commit to ipfs/kubo that referenced this pull request Dec 3, 2025
Wire up boxo's AllowCodecConversion config to control codec conversion
behavior per IPIP-0524. When false (default), the gateway returns
406 Not Acceptable if the requested format doesn't match the block's
codec.

Clients should fetch raw blocks (`?format=raw`) and convert client-side.

Ref: ipfs/specs#524
Ref: ipfs/boxo#1077
Ref: ipfs/gateway-conformance#254
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