Skip to content

Commit

Permalink
✨ feat: add support for parameters in content negotiation
Browse files Browse the repository at this point in the history
Attempts to approach the level of support offered by express,
but behavior may differ in unusual corner cases.
Some key behaviors from Express that are implemented:
 - If an offer does not have every parameter listed in the given Accept,
   it is rejected.
 - Parameters do not affect specificity.
 - In a given specificity, more parameters gives greater precedence
 - Parameters are unordered
 - Matching is case-insensitive
 - Surrounding quotes for parameter values are stripped
 - If an Accept type specifies a parameter more than once, the last
   value provided is taken.
 - Parameters after q are not processed.

https://www.rfc-editor.org/rfc/rfc9110#name-parameters
  • Loading branch information
nickajacks1 committed Oct 22, 2023
1 parent 37ad7c7 commit 21e7b98
Show file tree
Hide file tree
Showing 3 changed files with 495 additions and 64 deletions.
Loading

0 comments on commit 21e7b98

Please sign in to comment.