You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+4
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,10 @@ $ npm install co-body
24
24
25
25
-`limit` number or string representing the request size limit (1mb for json and 56kb for form-urlencoded)
26
26
-`strict` when set to `true`, JSON parser will only accept arrays and objects; when `false` will accept anything `JSON.parse` accepts. Defaults to `true`. (also `strict` mode will always return object).
27
+
-`onProtoPoisoning` Defines what action the `co-body` lib must take when parsing a JSON object with `__proto__`. This functionality is provided by [bourne](https://github.com/hapijs/bourne).
28
+
See [Prototype-Poisoning](https://fastify.dev/docs/latest/Guides/Prototype-Poisoning/) for more details about prototype poisoning attacks.
29
+
Possible values are `'error'`, `'remove'` and `'ignore'`.
30
+
Default to `'error'`, it will throw a `SyntaxError` when `Prototype-Poisoning` happen.
27
31
-`queryString` an object of options when parsing query strings and form data. See [qs](https://github.com/hapijs/qs) for more information.
28
32
-`returnRawBody` when set to `true`, the return value of `co-body` will be an object with two properties: `{ parsed: /* parsed value */, raw: /* raw body */}`.
29
33
-`jsonTypes` is used to determine what media type **co-body** will parse as **json**, this option is passed directly to the [type-is](https://github.com/jshttp/type-is) library.
0 commit comments