-
Notifications
You must be signed in to change notification settings - Fork 479
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
cjson encode table encodes /
#66
Comments
We have a similar issue. The JSON spec says you CAN escape forward slash, but you don't have to. |
same issue for me - |
dont expect to much, just do it yourself, this pull request is really helpful |
If anyone else is troubled by the escaped forward slash, thanks to #57 for showing me the solution, this is what I've been doing to apply the fix before lua-cjson is compiled. My example is in the context of openresty but the operative line is the sed replacement
|
For what it's worth, openresty's fork of cjson solves this problem: https://github.com/openresty/lua-cjson/#encode_escape_forward_slash |
thanks a lot, this helped me, a huge hug for you~ |
To help understand the impact a bit better, does anyone have examples where decodes or APIs break with:
If there is a clearly better choice we should just do that and avoid adding another configuration option. It sounds like Lua CJSON is an outlier here, and there would be fewer issues if it didn't escape forward slash. |
Doing:
prints
{"url":"https:\/\/google.com"}
. I'm trying to stringify a JSON object here, and don't expect to get the/
escaped. Is there any solution?The text was updated successfully, but these errors were encountered: