-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 causes InvalidURIError when spaces are used in the url #3118
Comments
I have the same problem when an invalid URL is requested:
It should catch the error and return an appropriate http status instead (406?) |
For me, it helped to escape the URI that I was passing to Redirect, so instead of redirect{ "http://example.com/assets/+%20option.html%20+"} I use redirect{ URI.escape("http://example.com/assets/+%20option.html%20+") } |
I've also found that URI.escape solved my problem for the following sample url. Before using URI.escape I too was getting InvalidURIError. |
It looks to me like this may be fixed now, is this still a problem? |
@steveklabnik yes, that will have fixed it - closing. |
Redirect uses params to reconstruct the url and params are not url encoded. This causes URI.parse to fail during redirection.
See actionpack/lib/action_dispatch/routing/redirection.rb line 91
The text was updated successfully, but these errors were encountered: