#35631: Include quality value when parsing Accept header
-----------------------------------------+-----------------------------
Reporter: Jake Howard | Owner: Jake Howard
Type: New feature | Status: assigned
Component: HTTP handling | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+-----------------------------
Requests have an `accepts` method for identifying the mimetype the user
can receive. However, when multiple formats are provided, a
[https://developer.mozilla.org/en-US/docs/Glossary/Quality_values "quality
value"] can be added to show the preferences on format. Handling this
value currently needs to be done by hand.
I propose:
1. Documenting the existence of `Request.accepted_types`
2. Extract the quality value, and store it as `MediaType.quality`
3. Sort `Request.accepted_types` by quality value
It would be nice to have an API to answer "I can return these mime types,
which would you prefer?", which I guess could be handled manually for now.
--
Ticket URL: <https://code.djangoproject.com/ticket/35631>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070190ea626779-2f5c5686-6578-4955-bfb9-c5dbab038b01-000000%40eu-central-1.amazonses.com.