node-restify
node-restify copied to clipboard
Plugins serveStatic fixes
Pre-Submission Checklist
- [ ] 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:
- Issue #1864
- Issue #1910
- Issue #1604
Well the most important is the directory traversal from #1910. And because of there are the other related problems in the serveStatic plugin, I've combined the stuff.
Changes
There should be no dependency on the dirname for specific path. Introduced BadRequestErrors for problems on bad paths like urlencoded null bytes. Added tests to check for traversals. Reworked existing tests for making more sense. Remove 2 doubled tests. lints and style of bodyReader.test fixed to get prepush to run