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
Member

jonasschnelli commented Jun 24, 2015

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.

@jonasschnelli jonasschnelli force-pushed the jonasschnelli:2015/06/json_escaping branch Jun 25, 2015
@laanwj laanwj added the RPC/REST/ZMQ label Jun 25, 2015
@laanwj
Copy link
Member

laanwj commented Jun 25, 2015

utACK

@jonasschnelli
Copy link
Member Author

jonasschnelli commented Jun 25, 2015

@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
Member Author

jonasschnelli commented Jun 25, 2015

Added covering for this escaping issue in univalue_tests.cpp.

@jonasschnelli jonasschnelli force-pushed the jonasschnelli:2015/06/json_escaping branch to 77aeb7c Jun 25, 2015
@laanwj laanwj merged commit 77aeb7c into bitcoin:master Jun 25, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.