Parses an Accept-Charset header string.
The Accept-Charset header string.
An array of AcceptCharset objects, sorted by weight.
Parses an Accept-Encoding header string.
The Accept-Encoding header string.
An array of AcceptEncoding objects, sorted by weight.
Parses an Accept-Language header string.
The Accept-Language header string.
An array of AcceptLanguage objects, sorted by weight.
Parses a single media range with corresponding parameters from an Accept header. For every parameter value that is a double quoted string, we check if it is a key in the replacements map. If yes the value from the map gets inserted instead.
A string corresponding to a media range and its corresponding parameters.
The double quoted strings that need to be replaced.
Accept object corresponding to the header string.
Parses a Forwarded header value.
The Forwarded header value.
The parsed Forwarded header.
Parses an Accept-* header where each part is only a value and a weight, so roughly /.(q=.)?/ separated by commas.
Input header string.
An array of ranges and weights.
Parses a list of split parameters and checks their validity.
A list of split parameters (token [ "=" ( token / quoted-string ) ])
The double quoted strings that need to be replaced.
An array of name/value objects corresponding to the parameters.
Splits the input string on commas, trims all parts and filters out empty ones.
Input header string.
Checks if the input string matches the qvalue regex.
Input qvalue string (so "q=....").
Replaces all double quoted strings in the input string with "0"
, "1"
, etc.
The Accept header string.
The transformed string and a map with keys "0"
, etc. and values the original string that was there.
Adds a header value without overriding previous values.