node-restify
node-restify copied to clipboard
Update response.send() to check HTTP status code length
I updated line 300 which checks that the HTTP status code passed into the Response.send() function is of type "number" to also check that the length of the status code is equal to three since all HTTP status codes are three digits. This allows for the Response.send() function to send ordinary numbers of any length ( other than three ) as response if need be, instead of throwing.
Pre-Submission Checklist
- [x] Opened an issue discussing these changes before opening the PR
- [ ] Ran the linter and tests via
make prepush
- [ ] Included comprehensive and convincing tests for changes
Issues
Closes:
- Issue #
- Issue #
- Issue #
Summarize the issues that discussed these changes
Changes
What does this PR do?
I don't think this would be a good feature like it is...
- It adds computation overhead to each and every request
- You can simply use something like https://www.npmjs.com/package/statuses and check it in your own code