-
Notifications
You must be signed in to change notification settings - Fork 375
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
Return result verbatim if raw=true
is provided in the query string
#1553
Conversation
|
image/*
is included in the Accept
header.raw=true
is provided in the query string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
So if i get this right.. this is for something like an image tag.. so it falls into the no js case but our setting of flash headers messes things.. or I guess more so us messing with the body encoding with seroval would be the issue. I don't like having to rely on query param.. but I also don't see a particularly great way to handle this in this case. Our options are to use the query param as you have if the caller makes that decision. Or to do something on the response, if the response makes that decision. It sort of feels like the response knows what it wants sent back. We could use the content-type headers of the response object maybe to make this decision. I guess that is a bit weird. I'm just unclear all the scenarios here and before adding a convention I'd like to consider them. |
IMO we should use the |
How about a response header
|
Yeah the problem with accept headers is things like image URLs can't set them I believe. So yeah response header seems the best option to me. It means being a bit more explicit in these cases but I think that makes sense. The only real question is if we just set one for raw or we leave it open. I guess raw is fine and then rely on the native body parser to handle the rest. We do have to consider both the nojs and js case though so its going to take a bit more wiring. I will take a stab it today I think. |
I went with going with "X-Content-Raw". So not going with this PR. Thanks for bring this up to my attention. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Described in #1550
What is the new behavior?
Can now specify that the response is returned verbatim by adding
?raw=true
to the query stringCloses #1550