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

Handle Infinity/NaN without invalid JSON #642

Closed
donaldatball opened this issue Nov 8, 2017 · 1 comment
Closed

Handle Infinity/NaN without invalid JSON #642

donaldatball opened this issue Nov 8, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@donaldatball
Copy link
Collaborator

@donaldatball donaldatball commented Nov 8, 2017

JSON explicitly disallows Infinity and NaN. Ruby and Python both have "allow_nan" flags that allow their JSON parsers to handle those values as "barewords" in the JSON string, but they cause problems elsewhere (specifically, Javascript rejects strings with those barewords). Instead of relying on the invalid JSON, we should convert those values into an object, similar to the way that non-printable strings/blocks are handled.

Note that I have no plans to actually set the allow_nan flag to false, so the bareword syntax will continue to work. It just won't be required.

@donaldatball donaldatball self-assigned this Nov 8, 2017
@donaldatball donaldatball added the feature label Nov 8, 2017
donaldatball added a commit that referenced this issue Nov 8, 2017
… without barewords.
donaldatball added a commit that referenced this issue Nov 8, 2017
re #642 Update json_rpc library to handle Infinity, -Infinity and NaN…
@donaldatball
Copy link
Collaborator Author

@donaldatball donaldatball commented Nov 8, 2017

Closed with 28b70d7.

@ryanmelt ryanmelt added this to the v4.1.0 milestone Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.