test!(ipip-523/v0.9): prefer format query param over accept header#252
Merged
test!(ipip-523/v0.9): prefer format query param over accept header#252
Conversation
When both are present, allow the query param to override the accept header
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
|
3 tasks
BREAKING CHANGE: these tests expect URL query parameters to take precedence over Accept header, which reverses the previous behavior. adds tests verifying URL query parameters take precedence over Accept header: - TestTrustlessCarFormatPrecedence: format=car/raw overrides Accept header - TestTrustlessCarParamPrecedence: car-order and car-dups override Accept params - moves "format=car respects Accept header CAR params" test to param precedence - updates hint in existing JSON format precedence test
When testing against Kubo master, display a note in job summary and PR comment explaining that failing tests require a companion Kubo PR that uses tests from this branch and passes CI.
lidel
added a commit
to ipfs/boxo
that referenced
this pull request
Dec 1, 2025
…pt header this change simplifies precedence rules by making the ?format= URL query parameter always take priority over the Accept HTTP header when both are present. in practice, this is largely compatible with existing browser use cases since browsers send Accept headers with wildcards which were already treated as non-specific. prioritizing ?format= also ensures deterministic HTTP caching behavior, protecting against CDNs that comingle different response types under the same cache key. the only breaking change is for edge cases where a client sends both a specific Accept header and a different ?format= value. previously Accept would win, now ?format= wins. this scenario is rare and arguably represents client misconfiguration. when detected, gateway returns HTTP 400 to signal the ambiguity. specs: ipfs/specs#523 tests: ipfs/gateway-conformance#252
1 task
lidel
added a commit
to ipfs/kubo
that referenced
this pull request
Dec 2, 2025
update boxo to ipfs/boxo#1074 and gateway-conformance tests to ipfs/gateway-conformance#252 for testing IPIP-523 changes where ?format= URL query parameter takes precedence over Accept HTTP header
2 tasks
lidel
added a commit
to ipfs/kubo
that referenced
this pull request
Dec 2, 2025
update boxo to ipfs/boxo#1074 and gateway-conformance tests to ipfs/gateway-conformance#252 for testing IPIP-523 changes where ?format= URL query parameter takes precedence over Accept HTTP header
lidel
added a commit
to ipfs/kubo
that referenced
this pull request
Dec 2, 2025
update boxo to ipfs/boxo#1074 and gateway-conformance tests to ipfs/gateway-conformance#252 for testing IPIP-523 changes where ?format= URL query parameter takes precedence over Accept HTTP header
lidel
approved these changes
Dec 2, 2025
Member
There was a problem hiding this comment.
Thank you, I've added a few more tests and implemented the IPIP-523 in:
- ipfs/boxo#1074
- ipfs/kubo#11086 (this is where we use everything end-to-end and want CI to be green – and it is!)
and works as expected.
If no concerns I'm going to release this later this week after I finish reviewing other IPIPs.
`car-order` and `car-dups` URL params depend on optional `order`/`dups` support from IPIP-412, matching `TestTrustlessCarOrderAndDuplicates`. Merged tests into `TestTrustlessCarOrderAndDuplicates` to keep all optional order/dups tests together.
lidel
added a commit
to ipfs/boxo
that referenced
this pull request
Dec 11, 2025
temporary switch to ipfs/gateway-conformance#252
lidel
approved these changes
Feb 4, 2026
Member
lidel
left a comment
There was a problem hiding this comment.
I'm going to tag a release with this shortly.
…ferring-format-over-accept
7f13643 to
222c941
Compare
222c941 to
cd68d00
Compare
Contributor
lidel
added a commit
to ipfs/boxo
that referenced
this pull request
Feb 4, 2026
* feat(gateway): IPIP-523 format query param takes precedence over Accept header this change simplifies precedence rules by making the ?format= URL query parameter always take priority over the Accept HTTP header when both are present. in practice, this is largely compatible with existing browser use cases since browsers send Accept headers with wildcards which were already treated as non-specific. prioritizing ?format= also ensures deterministic HTTP caching behavior, protecting against CDNs that comingle different response types under the same cache key. the only breaking change is for edge cases where a client sends both a specific Accept header and a different ?format= value. previously Accept would win, now ?format= wins. this scenario is rare and arguably represents client misconfiguration. when detected, gateway returns HTTP 400 to signal the ambiguity. specs: ipfs/specs#523 tests: ipfs/gateway-conformance#252 * docs(changelog): add IPIP-523 to unreleased * fix(gateway): IPIP-523 ?format always wins over Accept header remove HTTP 400 error for conflicting ?format and Accept values. instead, ?format silently takes precedence, which is simpler and less breaking for browser clients that send Accept headers automatically. * ci: use gateway-conformance with IPIP-523 tests temporary switch to ipfs/gateway-conformance#252 * chore(ci): switch to gateway-conformance@v0.9
lidel
added a commit
to ipfs/kubo
that referenced
this pull request
Feb 4, 2026
* test: IPIP-523 format query precedence over Accept header update boxo to ipfs/boxo#1074 and gateway-conformance tests to ipfs/gateway-conformance#252 for testing IPIP-523 changes where ?format= URL query parameter takes precedence over Accept HTTP header * chore: update boxo and gateway-conformance for IPIP-523 testing - boxo@9aeb0c835899fedb4f886040a4ccf3ba09fd97d4 - gateway-conformance@c82a2a9bc79303e0f07216a80cf454ef2a1e042c * chore(ci): switch to gateway-conformance@v0.9 * chore: update boxo with IPIP-523 changes * chore: update boxo to main after ipfs/boxo#1074 merge * docs: add gateway-conformance v0.9 to changelog
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.
When both are present, allow the query param to override the accept header.
BREAKING CHANGE: these tests expect URL query parameters to take precedence over Accept header, which reverses the previous behavior, needs to be released as minor release.