Skip to content

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

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
jonasschnelli:2015/06/json_escaping
Jun 25, 2015
Merged

UniValue: don't escape solidus, keep espacing of reverse solidus#6339
laanwj merged 1 commit into
bitcoin:masterfrom
jonasschnelli:2015/06/json_escaping

Conversation

@jonasschnelli

Copy link
Copy Markdown
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

luke-jr commented Jun 24, 2015

Copy link
Copy Markdown
Member

utACK

@theuni

theuni commented Jun 24, 2015

Copy link
Copy Markdown
Member

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

jgarzik commented Jun 25, 2015

Copy link
Copy Markdown
Contributor

Yes @theuni is correct.

@laanwj

laanwj commented Jun 25, 2015

Copy link
Copy Markdown
Member

utACK

@jonasschnelli

Copy link
Copy Markdown
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

jgarzik commented Jun 25, 2015

Copy link
Copy Markdown
Contributor

ut ACK

@jonasschnelli

Copy link
Copy Markdown
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