test!(ipip-524/v0.10): codec mismatch returns 406#254
Merged
Conversation
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
Contributor
|
Results against Kubo latest: Summary
|
Contributor
|
Results against Kubo master: Important See the action summary for full results. This PR cannot be merged until there is a Kubo PR that uses tests from this branch and passes CI. Link related PRs (boxo, kubo) in the PR description. Summary
|
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
2 tasks
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
Contributor
Member
Author
|
I'm going to ship this as v0.10 and include it in Kubo 0.40 RC1, together with the other two IPIPs. This way we group all "formally breaking changes" in one release that saves people time on testing (can smoke-test everything in one go). |
lidel
added a commit
to ipfs/boxo
that referenced
this pull request
Feb 5, 2026
* feat(gateway): add AllowCodecConversion config option 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 * ci: update gateway-conformance to e17586f4 * fix(gateway): 406 error now tells you how to get the data you need when codec conversion is disabled (IPIP-0524) and you request ?format=dag-json for a dag-pb block, the 406 response now suggests fetching the raw block with ?format=raw and converting client-side. covers dag-pb directories, dag-pb files, and raw blocks requested with ?format=dag-json or ?format=dag-cbor. plain ?format=json and Accept: application/json continue to serve the default response, so existing HTTP clients are not affected. * chore: update changelog with PR link for IPIP-0524 * fix(gateway): show only native codec download link in HTML preview only show the matching format download link (dag-json or dag-cbor) in the HTML preview page when AllowCodecConversion is disabled, preventing users from clicking links that would return 406. when AllowCodecConversion is enabled, both links are shown as before. * ci: switch gateway-conformance to v0.10
lidel
added a commit
to ipfs/kubo
that referenced
this pull request
Feb 6, 2026
…11090) * feat(gateway): IPIP-0524 Gateway.AllowCodecConversion config option 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 * chore: update boxo for improved 406 codec conversion error boxo now returns an actionable hint when codec conversion is rejected: suggests fetching raw block with ?format=raw and converting client-side. * chore: bump boxo and gateway-conformance to v0.10 * docs: add IPLD Logical Format note to AllowCodecConversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Implementations supporting optional codec conversions for backward compatibility are free to skip the 406 tests. I'll move conversion tests to
boxo/gatewayand make it configurable behind a config flag.This needs to be released as minor release as its technically a breaking change.