Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

MatchAccept() doesn't actually implement RFC 7231 Section 5.3.2 #3

@flamingcow66

Description

@flamingcow66

The doc for MatchAccept() contains conflicting statements:

// MatchAccept searches accept for the element that most closely matches
// mediaType, according to precedence rules of RFC 7231 Section 5.3.2.
// Only the bare type/subtype can be matched with this function;
// elements with Params are not considered. If nothing matches mediaType,
// a zero AcceptElem is returned.

RFC 7231 S 5.3.2 describes q param handling and goes into detail about how to apply it. Not supporting the q param is a valid choice (it's effectively saying "server's priority order takes precedence"), but that's not possible with MatchAccept(), since it skips AcceptElems with parameters entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions