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

Replacing URI.parse with Addressable #403

Closed
lucke84 opened this issue Apr 25, 2016 · 5 comments
Closed

Replacing URI.parse with Addressable #403

lucke84 opened this issue Apr 25, 2016 · 5 comments

Comments

@lucke84
Copy link
Contributor

lucke84 commented Apr 25, 2016

It seems the new rails_context method uses uri = URI.parse(request.original_url), which sometimes fails to parse URIs with non-ASCII characters (see react_on_rails_helper.rb, line 361)

Here's an example of a real-life(-ish) URI that should be supported but fails on our ReactOnRails powered website:

http://mywebsite.com/mypage?myparam=méridien

(note the é character in myparam's value), returning an error like:

URI::InvalidURIError: URI must be ascii only "http://mywebsite.com/mypage?myparam=mm\u{e9}ridien"

The addressable gem seems to be a valid alternative (which might become the official replacement for URI in the future). Unless I'm missing something here, is there a possibility to switch to using addressable?

Feedback of what I might be doing wrong (e.g. not encoding properly?) are more than welcome as well.

@jbhatab
Copy link
Member

jbhatab commented Apr 26, 2016

@lucke84 interesting. Would you mind making a PR for this?

@lucke84
Copy link
Contributor Author

lucke84 commented Apr 27, 2016

See #405 :)

@jbhatab
Copy link
Member

jbhatab commented Apr 29, 2016

@lucke84 looks good. just check out Justins comments, I agree with both of them. Besides that, awesome work.

@lucke84
Copy link
Contributor Author

lucke84 commented Apr 30, 2016

Happy to help :) The comment have been fixed already, it'd be nice to :shipit: .

@justin808
Copy link
Member

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants