Comparing version 6.0.0 to 6.0.1
@@ -0,1 +1,11 @@ | ||
<a name="6.0.1"></a> | ||
### 6.0.1 (2017-09-19) | ||
#### Bug Fixes | ||
* **cpuUsageThrottle:** Correctly named handler for debugInfo (#1499) ([78b0900b](git://github.com/restify/node-restify.git/commit/78b0900b)) | ||
* **server:** error in pre handler triggers after event (#1500) ([c2e6deae](git://github.com/restify/node-restify.git/commit/c2e6deae)) | ||
<a name="6.0.0"></a> | ||
@@ -2,0 +12,0 @@ ## 6.0.0 (2017-09-15) |
@@ -80,3 +80,3 @@ 'use strict'; | ||
*/ | ||
function cpuUsageThrottle (opts) { | ||
function cpuUsageThrottlePlugin (opts) { | ||
@@ -154,3 +154,3 @@ // Scrub input and populate our configuration | ||
function onRequest (req, res, next) { | ||
function cpuUsageThrottle (req, res, next) { | ||
// Check to see if this request gets rejected. Since, in updateReject, | ||
@@ -191,6 +191,6 @@ // we calculate a percentage of traffic we are planning to reject, we | ||
} | ||
onRequest.close = close; | ||
cpuUsageThrottle.close = close; | ||
// Expose internal plugin state for introspection | ||
Object.defineProperty(onRequest, 'state', { | ||
Object.defineProperty(cpuUsageThrottle, 'state', { | ||
get: function () { | ||
@@ -221,3 +221,3 @@ // We intentionally do not expose ewma since we don't want the user | ||
*/ | ||
onRequest.update = function update(newOpts) { | ||
cpuUsageThrottle.update = function update(newOpts) { | ||
assert.object(newOpts, 'newOpts'); | ||
@@ -257,5 +257,5 @@ assert.optionalNumber(newOpts.limit, 'newOpts.limit'); | ||
return onRequest; | ||
return cpuUsageThrottle; | ||
} | ||
module.exports = cpuUsageThrottle; | ||
module.exports = cpuUsageThrottlePlugin; |
@@ -756,13 +756,10 @@ // Copyright 2012 Mark Cavage, Inc. All rights reserved. | ||
self._run(req, res, null, self.before, function (err) { | ||
// check for return false here - like with the regular handlers, | ||
// if false is returned we already sent a response and should stop | ||
// processing. | ||
if (err === false) { | ||
self._finishReqResCycle(req, res); | ||
// Like with regular handlers, if we are provided an error, we | ||
// should abort the middleware chain and fire after events. | ||
if (err === false || err instanceof Error) { | ||
self._finishReqResCycle(req, res, null, err); | ||
return; | ||
} | ||
if (!err) { | ||
routeAndRun(); | ||
} | ||
routeAndRun(); | ||
}); | ||
@@ -769,0 +766,0 @@ } else { |
@@ -76,3 +76,3 @@ { | ||
], | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"repository": { | ||
@@ -79,0 +79,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
256403
5971