Chooses one of offered for the given Accept header, or undefined when
nothing acceptable is on offer (the caller's cue for a 406).
offered is in server preference order, which decides ties — so
negotiateContentType(accept, ["text/html", "application/json"]) prefers HTML
when a client says it takes either. An absent or empty header means "anything",
answered with the server's first choice, as RFC 9110 allows.
Chooses one of
offeredfor the givenAcceptheader, orundefinedwhen nothing acceptable is on offer (the caller's cue for a 406).offeredis in server preference order, which decides ties — sonegotiateContentType(accept, ["text/html", "application/json"])prefers HTML when a client says it takes either. An absent or empty header means "anything", answered with the server's first choice, as RFC 9110 allows.