Skip to content
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

Merged
merged 4 commits into from Mar 7, 2019
Merged

Conversation

rajatkumar
Copy link
Member

Pre-Submission Checklist

  • 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?
This PR upgrades the dependencies to use the latest versions. This also cleans up a couple of tests, and includes minor changes to and ensures restify uses the latest restify-error library.
Major libraries updated:

  • mocha
  • lru-cache
  • restify-error
  • mime
  • vasync
  • spdy

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();
Copy link
Contributor

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?

Copy link
Member Author

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.

@@ -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');
Copy link
Contributor

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)?

Copy link
Member Author

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+
Copy link
Contributor

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?

Copy link
Member Author

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;
Copy link
Contributor

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?

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants