-
-
Notifications
You must be signed in to change notification settings - Fork 633
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
Fix Encoding::UndefinedConversionError for IE browsers #518
Fix Encoding::UndefinedConversionError for IE browsers #518
Conversation
…ecover by force-encoding the URLs inside the payload as utf-8, assuming they were encoded in Windows Latin-2. This situation can only occur in browsers that do not encode the entire URL as UTF-8 already, meaning IE11 and lower. This is quite a common config as many people on Windows 7 still use IE11.
@lucke84 Thanks. Looks great. Please see https://github.com/shakacode/style-guide-javascript/blob/master/CONTRIBUTING.md. We need:
Reviewed 1 of 1 files at r1. app/helpers/react_on_rails_helper.rb, line 360 [r1] (raw file):
I'm guessing that we don't have to declare Comments from Reviewable |
@lucke84 If you have any production projects, please consider adding them to https://github.com/shakacode/react_on_rails/blob/master/PROJECTS.md Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. Comments from Reviewable |
Changes Unknown when pulling b7a6d66 on FindHotel:fix_undefined_conversion_error into * on shakacode:master*. |
@justin808 Will update the CHANGELOG and, if needed, the README. I'll run our app with our branch to see if it fixes the error properly today, then will codify a test for regression's sake. |
Quick update: I've greatly simplified the logic for handling the problematic situations. I find it a bit hard to create a test for this issue, the problem seems to be very much related to the Windows platform (mostly IE browsers, but I've seen it happening on Firefox as well). If you try and hit any URL in a ReactOnRails-powered app that contains a weird character in the querystring (e.g. Maybe somebody here can give it a go and:
|
@lucke84 Please check on why travis is failing. |
@lucke84 please run |
Reviewed 1 of 1 files at r3, 1 of 1 files at r5. Comments from Reviewable |
@lucke84 Please rebase on top of master and I'll merge this. |
…ecover by force-encoding the URLs inside the payload as utf-8, assuming they were encoded in Windows Latin-2. This situation can only occur in browsers that do not encode the entire URL as UTF-8 already, meaning IE11 and lower. This is quite a common config as many people on Windows 7 still use IE11.
…/react_on_rails into fix_undefined_conversion_error
…ecover by force-encoding the URLs inside the payload as utf-8, assuming they were encoded in Windows Latin-2. This situation can only occur in browsers that do not encode the entire URL as UTF-8 already, meaning IE11 and lower. This is quite a common config as many people on Windows 7 still use IE11.
…/react_on_rails into fix_undefined_conversion_error
@lucke84 Please squash your change down to one tidy commit with a detailed message: http://chris.beams.io/posts/git-commit/ |
@lucke84 I'd like to get 6.1 out this weekend. Let me know if you'll have a chance to fix your rebase. |
@justin808 I've tried the rebase and squash, but couldn't get the output I want (I'm not yet a huge fan of rebase, so I'm a bit out of practice). Will close this PR and open a new one off the latest master, ready to be merged. Is that ok? |
Created #525 where I've squashed the changes, but something went south there too. Let me know if that's fine or if I should create it again ¯_(ツ)_/¯ |
@lucke84 ASAP! That looks good. But squash to one commit! |
Closing in favour of #527. |
Check for encoding failure of the request's original_url and try to recover by force-encoding the URLs inside the payload as UTF-8, assuming they were encoded in Windows Latin-2.
This situation can only occur in browsers that do not encode the entire URL as UTF-8 already, meaning IE11 and lower. This is quite a common config as many people on Windows 7 still use IE11.
Here's the relevant part of the backtrace:
This is a patch we have already successfully applied to our codebase in other components. Truth to be told, though, I still have to try the fix within the ReactOnRails context. I will do it tomorrow, but I'd appreciate an initial round of feedback. Thanks!
This change is