#36411: get_preferred_type ignores params
-------------------------------+--------------------------------------
     Reporter:  magicfelix     |                    Owner:  (none)
         Type:  Bug            |                   Status:  new
    Component:  HTTP handling  |                  Version:  5.2
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Comment (by David Sanders):

 Perhaps someone can weigh in on the correct behaviour on matching mime
 types, but `MediaType.match()` only checks `<main-type>/<sub-type>`
 without consideration for the `; <params>`:

 {{{
     def match(self, other):
         if self.is_all_types:
             return True
         other = MediaType(other)
         return self.main_type == other.main_type and self.sub_type in {
             "*",
             other.sub_type,
         }
 }}}

 
https://github.com/django/django/blob/d2732c30af28381f5a2ff1b08f754eeb7a6dfeca/django/http/request.py#L716-L719
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36411#comment:1>
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/01070196fcd98b9e-f3e6fe71-0a6d-4feb-bcc9-e44921281eea-000000%40eu-central-1.amazonses.com.

Reply via email to