cojs / co-body

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

add a strict mode: throw when json-body is non-object #22

Closed dead-horse closed 9 years ago

dead-horse commented 9 years ago

rfc4627 also see https://github.com/koajs/bodyparser/issues/19#issuecomment-98367747.

dead-horse commented 9 years ago

or make it configuable like https://github.com/expressjs/body-parser#strict

haoxins commented 9 years ago

+1 for configuable, also default to strict: true.

dead-horse commented 9 years ago

sorry. rfc4627 is rewrited by rfc7159

JSON-text = ws value ws

but it is still good to have a strict mode for user-friendly