restify-clients
Advanced tools
Comparing version 2.6.7 to 2.6.8
@@ -0,1 +1,5 @@ | ||
<a name="2.6.8"></a> | ||
### 2.6.8 (2019-12-09) | ||
<a name="2.6.7"></a> | ||
@@ -2,0 +6,0 @@ ### 2.6.7 (2019-07-28) |
@@ -192,3 +192,3 @@ // Copyright 2012 Mark Cavage, Inc. All rights reserved. | ||
*/ | ||
var emitAfter = once.strict(function _emitAfter(_req, _res, _err) { | ||
var emitAfter = once(function _emitAfter(_req, _res, _err) { | ||
assert.optionalObject(_err, '_err'); | ||
@@ -223,3 +223,3 @@ assert.object(_req, '_req'); | ||
*/ | ||
var emitResult = once.strict(function _emitResult(_err, _req, _res) { | ||
var emitResult = once(function _emitResult(_err, _req, _res) { | ||
assert.optionalObject(_err, '_err'); | ||
@@ -422,8 +422,15 @@ assert.object(_req, '_req'); | ||
// not propagated via the callback, but instead propagated via the | ||
// 'result' event. check the cbCalled flag to ensure we don't double | ||
// call the callback. while this could be handled by once, this is more | ||
// explicit and easier to reason about. | ||
// 'result' event. In this scenario, cb's invocation here will no-op. | ||
cb(realErr, req); | ||
process.nextTick(function () { | ||
// 'error' emitted after 'response' or 'end' on IncomingMessage is | ||
// a known surprising to consumers scenario, and so is disregarded | ||
// by wrapping both emitResult & emitAfter w/once() for 2 reasons: | ||
// 1. The legacy implementation here did not propagate it. | ||
// 2. In the future, core likely won't for the same reason: | ||
// https://github.com/nodejs/node/issues/27916 | ||
// https://github.com/nodejs/node/pull/29197 | ||
// https://github.com/nodejs/node/pull/20077 | ||
// https://github.com/nodejs/node/pull/28683 | ||
emitResult(realErr, req, null); | ||
@@ -903,3 +910,3 @@ emitAfter(req, null, realErr); | ||
/* eslint-disable no-param-reassign */ | ||
cb = once.strict(cb); | ||
cb = once(cb); | ||
/* eslint-enable no-param-reassign */ | ||
@@ -906,0 +913,0 @@ |
{ | ||
"name": "restify-clients", | ||
"version": "2.6.7", | ||
"version": "2.6.8", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "description": "HttpClient, StringClient, and JsonClient extracted from restify", |
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
105651
2090