Hi all,
In Django 5.2, a feature was added to improve how Django parses the Accept
header.
Since then, some questions have come up about how closely it sticks to the RFC (well, both of them). Specifically in precedence of the provided types. Notably, ticket #36411 (resolved) and #36447. After many conversations with @nessita, we think what we have is likely correct - that specificity takes precedence over the raw quality (q
) value, as mentioned in the RFC:
Media ranges can be overridden by more specific media ranges or specific media types. If more than one media range applies to a given type, the most specific reference has precedence.
However, as with all RFCs, the devil is in the detail, and it may be a counter-intuitive implementation for some.
Interested in hearing what other people think of the implementation and how closely it sticks. If anyone knows a domain expert in these lovely RFCs, or similar implementations, I’d be very interested!