cojs / co-body

Parse request bodies with co
MIT License
325 stars 42 forks source link

feat: Protect against prototype poisoning #87

Closed fengmk2 closed 4 months ago

fengmk2 commented 4 months ago

follow https://github.com/fastify/fastify/pull/1427

throw SyntaxError when prototype poisoning happen by default

closes https://github.com/cojs/co-body/issues/70

fengmk2 commented 4 months ago

https://github.com/expressjs/body-parser/issues/347

fengmk2 commented 4 months ago

performance https://github.com/expressjs/body-parser/issues/347#issuecomment-461896920

JSON.parse(): 476,018 ops/sec
Bourne.parse(): 458,014 ops/sec
JSON.parse() followed by Bourne.scan(): 380,877 ops/sec
JSON.parse() with reviver: 183,411 ops/sec