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

Priority of accept types is incorrect if the client specifies no q factor #688

Open
staticfinal opened this issue Oct 21, 2016 · 1 comment · May be fixed by #1235
Open

Priority of accept types is incorrect if the client specifies no q factor #688

staticfinal opened this issue Oct 21, 2016 · 1 comment · May be fixed by #1235
Labels

Comments

@staticfinal
Copy link

staticfinal commented Oct 21, 2016

I have multiple routes for the same URL with different accept types:

        Spark.get("/channel/:version/", new GetChannelFeed());
        Spark.get("/channel/:version/", "text/html", new GetChannelFeedHtml(), templateEngine);

I get the HTML version of the channel in all browsers except IE. There I get the RSS feed. The reason is that IE sends an Accept header without q factor < 1 for "/".

The full accept header for IE is "text/html, application/xhtml+xml, /". So both the text/html Route and the / Route match with the same quality.

But the standard is pretty clear that in this case the most specific media range should be preferred:

If more than one media range applies to a given type, the most specific reference has precedence.
https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

So I should get the HTML Version and not the RSS feed.

@Chauncey-Xxy
Copy link

I will try to fix it.

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