Skip to content

Commit 06f8cc5

Browse files
committed
docs(IPIP-0523): document why no HTTP 400 on format conflict
add alternative explaining why we don't error when Accept header and ?format disagree: complexity, real-world HTTP infra behavior, and testability concerns
1 parent 1c8d369 commit 06f8cc5

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

src/ipips/ipip-0523.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "IPIP-0523: Prefer format param over Accept header"
3-
date: 2025-11-26
3+
date: 2025-12-11
44
ipip: proposal
55
editors:
66
- name: Alex Potsides
@@ -16,6 +16,12 @@ editors:
1616
url: https://ipshipyard.com
1717
relatedIssues:
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
1925
order: 523
2026
tags: ['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
110118
carve-out where wildcards (e.g., `*/*`, `application/*`) in the `Accept` HTTP
111119
header did not take precedence over the `format` URL query parameter. This meant
112120
browser use cases were effectively supported, since browsers include wildcards
@@ -119,6 +127,32 @@ This alternative was rejected because:
119127
3. The simpler rule ("format always wins") is easier to understand and implement
120128
4. 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

124158
Implementers can either write own test that prefers the `format` URL query

0 commit comments

Comments
 (0)