|
1 |
| -# JSON->URL |
2 |
| -[](https://opensource.org/licenses/MIT) |
| 1 | +# JSON→URL |
| 2 | +[][license] |
3 | 3 |
|
4 | 4 | ## About
|
5 |
| -RFC8259 describes the JSON data model and interchange format, which is widely |
| 5 | +[RFC8259][RFC8259] describes the JSON data model and interchange format, which is widely |
6 | 6 | used in application-level protocols including RESTful APIs. It is common for
|
7 |
| -applications to request resources via the HTTP POST method, with JSON entities, |
8 |
| -however, POST is suboptimal for requests which do not modify a resource's |
9 |
| -state. JSON->URL defines a text format for the JSON data model suitable for use |
10 |
| -within a URL/URI (as described by RFC3986). |
| 7 | +applications to request resources via the HTTP POST method, with JSON entities. |
| 8 | +However, POST is suboptimal for requests which do not modify a resource's |
| 9 | +state. JSON→URL defines a text format for the JSON data model suitable |
| 10 | +for use within a [URL][RFC1738]/[URI][RFC3986]. |
11 | 11 |
|
12 | 12 | ## The JavaScript API
|
13 |
| -JSON->URL is available as a commonjs module (suitable for use in Node), ES6 |
| 13 | +JSON→URL is available as a commonjs module (suitable for use in Node), ES6 |
14 | 14 | module, or a script that may be used directly in a browser. The API is the
|
15 | 15 | same for all three.
|
16 | 16 | ```js
|
17 | 17 | let p = new JsonURL();
|
18 | 18 | let value = p.parse( "(Hello:World!)" );
|
19 | 19 | ```
|
20 |
| -There are options available, but that's all you need to get started. |
| 20 | +There are options available, but that's all you need to get started. |
| 21 | + |
| 22 | +## Security |
| 23 | +The parser is designed to parse untrusted input. It supports limits on |
| 24 | +the number of parsed values and depth of nested arrays or objects. |
| 25 | +When the limit is exceeded an Error is thrown, and sane limit values are |
| 26 | +set by default. |
| 27 | + |
| 28 | +[RFC8259]: https://tools.ietf.org/html/rfc8259 |
| 29 | +[RFC3986]: https://tools.ietf.org/html/rfc3986 |
| 30 | +[RFC1738]: https://tools.ietf.org/html/rfc1738 |
| 31 | +[license]: https://opensource.org/licenses/MIT |
0 commit comments