New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dev): upgrading modules including restify-errors #1755
Conversation
lib/server.js
Outdated
@@ -1164,7 +1165,8 @@ Server.prototype._setupRequest = function _setupRequest(req, res) { | |||
// we consider a closed request as flushed from metrics point of view | |||
function onReqAborted() { | |||
// Request was aborted, override the status code | |||
var err = new errors.RequestCloseError(); | |||
//var err = new errors.RequestCloseError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to keep this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will get rid of it, this is not needed.
test/server.test.js
Outdated
@@ -10,7 +10,7 @@ var http = require('http'); | |||
var stream = require('stream'); | |||
|
|||
var errors = require('restify-errors'); | |||
var filed = require('filed'); | |||
// var filed = require('filed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to keep this commented out (as well as the test below)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will get rid of it, this is not needed.
@@ -2,5 +2,8 @@ | |||
|
|||
var errors = require('restify-errors'); | |||
|
|||
errors.makeConstructor('RequestCloseError'); | |||
errors.makeConstructor('RouteMissingError'); | |||
// This allows Restify to work with restify-errors v6+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity: what is the change in restify v6+ that requires this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In v5 of restify-errors
the function call to makeConstructor
added the constructor to restify-errors
exports. This changed in v6 and the recommendation was that the consumer should keep a reference to the new error constructor.
@@ -38,7 +38,7 @@ function acceptParser(accepts) { | |||
return a; | |||
}) | |||
.map(function map(a) { | |||
return a.indexOf('/') === -1 ? mime.lookup(a) : a; | |||
return a.indexOf('/') === -1 ? mime.getType(a) : a; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between mime.lookup
and mime.getType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookup
was renamed to getType
in the newer version of mime
.
Pre-Submission Checklist
make prepush
Issues
Closes:
Changes