Giraffe icon indicating copy to clipboard operation
Giraffe copied to clipboard

Accept: */* header does not pass mustAccept

Open avallee opened this issue 3 years ago • 1 comments

Using the handler mustAccept ["text/html"] with a request with the exact accept header: "/" fails by skipping the pipeline.

According to rfc7231 Section 5.3.2

The asterisk "" character is used to group media types into ranges, with "/" indicating all media types and "type/" indicating all subtypes of that type. The media-range can include media type parameters that are applicable to that range.

avallee avatar Jun 18 '21 13:06 avallee

This does look to be broken. Fortunately, we can do the Giraffe thing and lean on the MediaTypeHeaderValue class which has a isSubsetOf method that should help in this scenario.

I've created a PR with tests I'll add.

Banashek avatar Jul 06 '22 20:07 Banashek