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
Default URI format is forced over Accept header #19514
Comments
@gmile will it change respond_with behavior? |
@kostyl hmm, no, I don't think anything should break. Things to consider:
|
The So, setting it as a route's default parameter is not something I'd expect to need a lot. .. what behaviour were you intending to achieve? |
@matthewd I 100% agree with you. I'd expect the following:
Meanwhile, in our app we've removed |
Yeah, that's not going to happen: browsers (for example) always send |
@matthewd hmm indeed, now I fully understand your point. Thank you! |
Actually I came here with the question: Should server relay on Unfortunately I did not find any RFC or specs that define this precedence explicitly. My personal opinion is:
So priority should be next:
May someone provide proof link for this? |
Rails forces format, specified in default over the one, provided in
Accept
header.This is somewhat counterintuitive. Semantic meaning of
default
is to yield a fallback option if no other option was provided. However, right nowdefault
is forced.Upon digging up the Rails, codebase, it became apparent that Rails takes the
format
param as the one having priority overAccept
header.I personally don't think it is correct, but I can't quickly establish anything RFC-like to prove which one should take precedence: the inferred (in my case: default) response content type, or the one provided by the
Accept
header.I'm going to provide an example app (via a template) to back my point.
The text was updated successfully, but these errors were encountered: