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

UniValue: don't escape solidus, keep espacing of reverse solidus #6339

Merged
merged 1 commit into from
Jun 25, 2015

Conversation

jonasschnelli
Copy link
Contributor

After the JSON RFC, solidus ('/') must not be escaped (https://www.ietf.org/rfc/rfc4627.txt see paragraph 2.5)

JSON spirit did not escape a solidus.

Escaping the solidus character made things look bad in bitcoin-cli (or possibly over other RPC clients).

Example:
Before this PR:
http:\/\/127.0.0.1:8332

After this PR:
http://127.0.0.1:8332

@luke-jr
Copy link
Member

luke-jr commented Jun 24, 2015

utACK

@theuni
Copy link
Member

theuni commented Jun 24, 2015

I believe univalue/gen.cpp needs to be updated and run to re-generate this, no? I assume you just hand-edited this, but we should still ensure that it's still producing correct output.

@jgarzik
Copy link
Contributor

jgarzik commented Jun 25, 2015

Yes @theuni is correct.

@laanwj
Copy link
Member

laanwj commented Jun 25, 2015

utACK

@jonasschnelli
Copy link
Contributor Author

@theuni: Meh. Thanks! Wasn't aware of that. Fixed the gen.cpp file, gcc gen.cpp, ./a.out > univalue_escapes.h. The resulted file gave no changes to my manually edited file. The updated gen.cpp is now also included in this PR.

@jgarzik
Copy link
Contributor

jgarzik commented Jun 25, 2015

ut ACK

@jonasschnelli
Copy link
Contributor Author

Added covering for this escaping issue in univalue_tests.cpp.

@jonasschnelli jonasschnelli force-pushed the 2015/06/json_escaping branch from 409291e to 77aeb7c Compare June 25, 2015 06:10
@laanwj laanwj merged commit 77aeb7c into bitcoin:master Jun 25, 2015
laanwj added a commit that referenced this pull request Jun 25, 2015
77aeb7c UniValue: don't escape solidus, keep espacing of reverse solidus (Jonas Schnelli)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants