node-restify
node-restify copied to clipboard
fix: bodyReader works with gunzip and maxBodySize
Pre-Submission Checklist
- [X] Opened an issue discussing these changes before opening the PR
- [X] Ran the linter and tests via
make prepush
- [X] Included comprehensive and convincing tests for changes
Issues
Closes:
- https://github.com/restify/node-restify/issues/1785
Changes
Adds error handling for Gunzip errors so node process does not die. Fixes handling "413 Payload Too Large" for gzip encoded content.
Dear maintainers, please review this and approve!
It's a pity that Restify may be crashed just by setting Content-Encoding: gzip
and POST-ing plain text body.
One workaround is server.on('uncaughtException'
, but it's bad and deprecated.