11---
22title : " IPIP-0523: Prefer format param over Accept header"
3- date : 2025-11-26
3+ date : 2025-12-11
44ipip : proposal
55editors :
66 - name : Alex Potsides
@@ -16,6 +16,12 @@ editors:
1616 url : https://ipshipyard.com
1717relatedIssues :
1818 - https://github.com/ipfs/specs/issues/521
19+ thanks :
20+ - name : Adin Schmahmann
21+ github : aschmahmann
22+ affiliation :
23+ name : Shipyard
24+ url : https://ipshipyard.com
1925order : 523
2026tags : ['ipips']
2127---
@@ -106,7 +112,9 @@ change authentication, authorization, or data integrity behaviors.
106112
107113### Alternatives
108114
109- ** Keep status quo with wildcard exception** : The previous spec already had a
115+ #### Keep status quo with wildcard exception
116+
117+ The previous spec already had a
110118carve-out where wildcards (e.g., ` */* ` , ` application/* ` ) in the ` Accept ` HTTP
111119header did not take precedence over the ` format ` URL query parameter. This meant
112120browser use cases were effectively supported, since browsers include wildcards
@@ -119,6 +127,32 @@ This alternative was rejected because:
1191273 . The simpler rule ("format always wins") is easier to understand and implement
1201284 . Real-world browser use cases work identically under both rules
121129
130+ #### Return HTTP 400 on conflicting format preferences
131+
132+ Require gateways to return HTTP 400 when the ` Accept ` header and ` format `
133+ parameter specify different formats, signaling client misconfiguration.
134+
135+ This was rejected as impractical:
136+
137+ 1 . ** Reintroduces complexity** : Detecting "conflicts" requires fully parsing
138+ ` Accept ` headers, handling wildcards and quality values - the very complexity
139+ this IPIP eliminates.
140+
141+ 2 . ** Incompatible with real-world HTTP infrastructure** : CDNs and reverse proxies
142+ (Nginx, Cloudflare, etc.) routinely strip, transform, or ignore ` Accept `
143+ headers. When requests traverse multiple hops, each with different behaviors,
144+ the ` Accept ` header often doesn't reach the gateway intact. The URL is the
145+ only reliable cache key across the entire stack.
146+
147+ 3 . ** Untestable in practice** : Conformance tests expecting HTTP 400 would
148+ spuriously pass or fail depending on whether upstream infrastructure forwarded
149+ the ` Accept ` header. This creates a specification that cannot be reliably
150+ verified.
151+
152+ The chosen approach - ` format ` always takes precedence, no error on disagreement -
153+ is a pragmatic choice that minimizes implementation complexity and maximizes
154+ interoperability with real-world HTTP clients, CDNs, reverse proxies, and caches.
155+
122156## Test fixtures
123157
124158Implementers can either write own test that prefers the ` format ` URL query
0 commit comments