-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Redirect does not terminate the response, which may be confusing #725
Comments
I think not Exceptions for flow control are very expensive. I would like it more this way: error() and return if ...
present(...) and return if ... |
I concur with @dspaeth-faber, Rails and others all make redirect behave in this way. |
Additionally: Not setting the This fails: get '/' do
redirect '/v1'
end With this xml error: <error>
<message>cannot convert String to xml</message>
</error> This redirects correctly: format :json
get '/' do
redirect '/v1'
end |
Grame really defaults (should default :)) to JSON, not sure what the deal here is, you might want to dig a bit deeper? |
Might be grape-roar interfering and defaulting to xml. |
I got caught by surprise that
redirect
doesn't terminate the response. Added myself aredirect!
like so, but maybe this needs to at least be documented or an option added to stop the response:The text was updated successfully, but these errors were encountered: