(accept-fragment f)
Take something like "text/html" or "image/; q=0.8" and return a map like {:type ["image" ""] :q 0.8}
If the fragment is invalid, nil is returned.
Take something like "text/html" or "image/*; q=0.8" and return a map like {:type ["image" "*"] :q 0.8} If the fragment is invalid, nil is returned.
(acceptable-type type-pair acceptable-pair)
Compare two type pairs. If the pairing is acceptable, return the most specific. E.g., for
["text" "plain"] ["" ""]
returns
["text" "plain"].
Compare two type pairs. If the pairing is acceptable, return the most specific. E.g., for ["text" "plain"] ["*" "*"] returns ["text" "plain"].
(best-allowed-content-type accepts-header)
(best-allowed-content-type accepts-header allowed-types)
Return the first type in the Accept header that is acceptable. allowed-types is a set containing pairs (e.g., ["text" "*"]) or strings (e.g., "text/plain").
Definition of "acceptable": An Accept header fragment of "text/" is acceptable when allowing "text/plain". An Accept header fragment of "text/plain" is acceptable when allowing "text/".
Return the first type in the Accept header that is acceptable. allowed-types is a set containing pairs (e.g., ["text" "*"]) or strings (e.g., "text/plain"). Definition of "acceptable": An Accept header fragment of "text/*" is acceptable when allowing "text/plain". An Accept header fragment of "text/plain" is acceptable when allowing "text/*".
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close