Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept: */* header does not pass mustAccept #485

Open
avallee opened this issue Jun 18, 2021 · 1 comment
Open

Accept: */* header does not pass mustAccept #485

avallee opened this issue Jun 18, 2021 · 1 comment

Comments

@avallee
Copy link

avallee commented Jun 18, 2021

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.

@Banashek
Copy link
Contributor

Banashek commented Jul 6, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants