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

Wrong quality ranking when q parameter is not a float #2476

Open
ericproulx opened this issue Jul 21, 2024 · 0 comments
Open

Wrong quality ranking when q parameter is not a float #2476

ericproulx opened this issue Jul 21, 2024 · 0 comments
Labels

Comments

@ericproulx
Copy link
Contributor

ericproulx commented Jul 21, 2024

I've noticed that processing application/json;q=invalid,application/xml;q=0.5 would set the Grape::Env::API_FORMAT to xml when it should be json. Unfortunately, the RFC isn't clear when q is not a float. Nonetheless the default value is 1.0 and Rack applies it when q is not a float.

My recommendation would be to follow Rack's implementation an probably use its best_q_match function instead of our own.

@dblock dblock added the bug? label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants