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

SSID's with a backslash in the name are not properly escaped in the JSON response from scan-ap #3

Open
ScottMansfield opened this issue Dec 30, 2016 · 0 comments

Comments

@ScottMansfield
Copy link

Through much trial and tribulation I have discovered that the reason the Oak setup page could not connect is that the JSON being returned from the main web server is not well formed. If the SSID of any network within range has a backslash in it that does not create a "proper" JSON escape sequence, the parse JSON call in the web page rejects it (correctly) as malformed JSON and refuses to continue.

The root cause is here:

JSONScan += WiFi.SSID(i);

In that line, the contents of the SSID are dumped directly into the JSON without any escaping. Any strings put into the JSON need to be properly escaped to prevent this from happening. It's pretty uncommon to have a backslash in your SSID, I admit, but this took a long time to track down. The setup webpage only said that it couldn't connect, which is false, and I had to create my own versions of the page with error logging added to see what the actual problem was.

I'm personally debating doing a PR or just continuing on with my hacked up workaround to properly escape the JSON on the client side.

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

1 participant