Skip to content

Conversation

@achingbrain
Copy link
Member

@achingbrain achingbrain commented Nov 26, 2025

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.

When both are present, allow the query param to override the accept header
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Results against Kubo latest:

Summary

Tests Failures Errors Skipped
1340 13 0 0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

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

Tests Failures Errors Skipped
1340 13 0 0

@lidel lidel changed the title test: prefer format query param over accept header test!(ipip-523): prefer format query param over accept header Dec 1, 2025
lidel added 2 commits December 1, 2025 23:33
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 lidel self-assigned this Dec 1, 2025
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
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 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
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I've added a few more tests and implemented the IPIP-523 in:

and works as expected.

If no concerns I'm going to release this later this week after I finish reviewing other IPIPs.

@lidel lidel marked this pull request as ready for review December 2, 2025 00:58
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.

3 participants