openresty / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
http://www.kyne.com.au/~mark/software/lua-cjson.php
MIT License
434 stars 119 forks source link

Add configuration option to disable forward slash escaping #62

Closed spacewander closed 4 years ago

spacewander commented 4 years ago

This PR is based on #59. Thanks @exjesper for the original patch. I just remove the detection from the hot path to make it a little faster when the escape is disabled.

agentzh commented 4 years ago

I'm not sure about this one since it leads to invalid JSON output. See json.org for the syntax spec for JSON.

agentzh commented 4 years ago

OK, I had a closer look and it seems escaping / is optional, not mandatory. Then it's fine.

spacewander commented 4 years ago

@agentzh Also add doc for the new method.

exjesper commented 4 years ago

Thanks @spacewander this looks better :+1: , I'll close my PR.