#36447: HttpRequest.get_preferred_type misorders types when more specific 
accepted
types have lower q
--------------------------------------+------------------------------------
     Reporter:  Anders Kaseorg        |                    Owner:  (none)
         Type:  Bug                   |                   Status:  new
    Component:  HTTP handling         |                  Version:  5.2
     Severity:  Normal                |               Resolution:
     Keywords:  preferred media type  |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Comment (by Anders Kaseorg):

 The most specific reference has precedence ''for the purpose of assigning
 the correct quality factor''. This is clear from the part I quoted.

   The media type quality factor associated with a given type is determined
 by finding the media range with the highest precedence that matches the
 type.

 The precedence is used to compute the quality factor for each type, and
 then the computed quality factors are compared to find the most favorable
 type.

 Your interpretation, where the precedence is used a second time to
 override the already-computed qualities during comparison, makes no sense:
 the RFC would not go to the effort of showing a detailed example where
 text/plain;format=flowed receives a lower quality factor than text/plain
 if there were no way for that lower quality to affect the final outcome.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36447#comment:4>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019755ccf4e5-2ffd3735-219c-47fd-80ef-ccb698c151ce-000000%40eu-central-1.amazonses.com.

Reply via email to