tinyhttp / milliparsec

🌌 Tiniest body parser in the universe. Built for modern Node.js
https://npm.im/milliparsec
MIT License
165 stars 7 forks source link

fix: allow empty json body #20

Closed fernando7jr closed 1 year ago

fernando7jr commented 1 year ago

The json middleware crashes when it receives an empty string from req.chunk. This causes JSON.parse() to throw an exception since it does not accept empty strings.