Skip to content

MIMEAccept doesn't respect specificity #458

Description

@dougblack

Hello!

I've been using the helpful MIMEAccept class in werkzeug.datastructures and I noticed that while it does respect quality, it doesn't respect specificity as outlined in RFC 2616.

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. For example,

Accept: text/, text/html, text/html;level=1, */
have the following precedence:

  1. text/html;level=1
  2. text/html
  3. text/*
  4. /

Is this something that people are interested in seeing fixed? I'd be happy to open a pull.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions