Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
common/escape: do not escape / in json #14130
It's annoying, but it seems to be the standard.
this one drives me nuts.
I'd say we should omit the , since that's what python does by default:
The only case where it matters is an embedded string in js. Parsing the json explicitly with js avoids that problem, so I don't see a reason for us to do this. If necessary, it could be transformed to having escaped '/'s by whatever is embedding it in html as well.
Spec on http://json.org/ is not precise. It says:
A string is any unicode character except " or \ or 'control character'.
This is a more precise spec: http://www.ietf.org/rfc/rfc4627.txt . It says:
The representation of strings is similar to conventions used in the C
It seems a JSON encoder can choose to escape any character, it must escape certain ones. / falls in "choose to escape" section not in "must escape".
'passes' rgw suite: http://pulpito.ceph.com/cbodley-2017-04-03_16:14:27-rgw-wip-cbodley-testing---basic-mira (failures are unrelated)