@digipair/skill-push-notification 0.63.0 → 0.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +119 -42
- package/index.esm.js +119 -42
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -6413,20 +6413,69 @@ function setup(env) {
|
|
|
6413
6413
|
createDebug.namespaces = namespaces;
|
|
6414
6414
|
createDebug.names = [];
|
|
6415
6415
|
createDebug.skips = [];
|
|
6416
|
-
var
|
|
6417
|
-
var
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6416
|
+
var split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
6417
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
6418
|
+
try {
|
|
6419
|
+
for(var _iterator = split[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
6420
|
+
var ns = _step.value;
|
|
6421
|
+
if (ns[0] === "-") {
|
|
6422
|
+
createDebug.skips.push(ns.slice(1));
|
|
6423
|
+
} else {
|
|
6424
|
+
createDebug.names.push(ns);
|
|
6425
|
+
}
|
|
6422
6426
|
}
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6427
|
+
} catch (err) {
|
|
6428
|
+
_didIteratorError = true;
|
|
6429
|
+
_iteratorError = err;
|
|
6430
|
+
} finally{
|
|
6431
|
+
try {
|
|
6432
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6433
|
+
_iterator.return();
|
|
6434
|
+
}
|
|
6435
|
+
} finally{
|
|
6436
|
+
if (_didIteratorError) {
|
|
6437
|
+
throw _iteratorError;
|
|
6438
|
+
}
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
}
|
|
6442
|
+
/**
|
|
6443
|
+
* Checks if the given string matches a namespace template, honoring
|
|
6444
|
+
* asterisks as wildcards.
|
|
6445
|
+
*
|
|
6446
|
+
* @param {String} search
|
|
6447
|
+
* @param {String} template
|
|
6448
|
+
* @return {Boolean}
|
|
6449
|
+
*/ function matchesTemplate(search, template) {
|
|
6450
|
+
var searchIndex = 0;
|
|
6451
|
+
var templateIndex = 0;
|
|
6452
|
+
var starIndex = -1;
|
|
6453
|
+
var matchIndex = 0;
|
|
6454
|
+
while(searchIndex < search.length){
|
|
6455
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
6456
|
+
// Match character or proceed with wildcard
|
|
6457
|
+
if (template[templateIndex] === "*") {
|
|
6458
|
+
starIndex = templateIndex;
|
|
6459
|
+
matchIndex = searchIndex;
|
|
6460
|
+
templateIndex++; // Skip the '*'
|
|
6461
|
+
} else {
|
|
6462
|
+
searchIndex++;
|
|
6463
|
+
templateIndex++;
|
|
6464
|
+
}
|
|
6465
|
+
} else if (starIndex !== -1) {
|
|
6466
|
+
// Backtrack to the last '*' and try to match more characters
|
|
6467
|
+
templateIndex = starIndex + 1;
|
|
6468
|
+
matchIndex++;
|
|
6469
|
+
searchIndex = matchIndex;
|
|
6426
6470
|
} else {
|
|
6427
|
-
|
|
6471
|
+
return false; // No match
|
|
6428
6472
|
}
|
|
6429
6473
|
}
|
|
6474
|
+
// Handle trailing '*' in template
|
|
6475
|
+
while(templateIndex < template.length && template[templateIndex] === "*"){
|
|
6476
|
+
templateIndex++;
|
|
6477
|
+
}
|
|
6478
|
+
return templateIndex === template.length;
|
|
6430
6479
|
}
|
|
6431
6480
|
/**
|
|
6432
6481
|
* Disable debug output.
|
|
@@ -6434,7 +6483,7 @@ function setup(env) {
|
|
|
6434
6483
|
* @return {String} namespaces
|
|
6435
6484
|
* @api public
|
|
6436
6485
|
*/ function disable() {
|
|
6437
|
-
var namespaces = _to_consumable_array(createDebug.names
|
|
6486
|
+
var namespaces = _to_consumable_array(createDebug.names).concat(_to_consumable_array(createDebug.skips.map(function(namespace) {
|
|
6438
6487
|
return "-" + namespace;
|
|
6439
6488
|
}))).join(",");
|
|
6440
6489
|
createDebug.enable("");
|
|
@@ -6447,32 +6496,52 @@ function setup(env) {
|
|
|
6447
6496
|
* @return {Boolean}
|
|
6448
6497
|
* @api public
|
|
6449
6498
|
*/ function enabled(name) {
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6499
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
6500
|
+
try {
|
|
6501
|
+
for(var _iterator = createDebug.skips[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
6502
|
+
var skip = _step.value;
|
|
6503
|
+
if (matchesTemplate(name, skip)) {
|
|
6504
|
+
return false;
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6507
|
+
} catch (err) {
|
|
6508
|
+
_didIteratorError = true;
|
|
6509
|
+
_iteratorError = err;
|
|
6510
|
+
} finally{
|
|
6511
|
+
try {
|
|
6512
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6513
|
+
_iterator.return();
|
|
6514
|
+
}
|
|
6515
|
+
} finally{
|
|
6516
|
+
if (_didIteratorError) {
|
|
6517
|
+
throw _iteratorError;
|
|
6518
|
+
}
|
|
6458
6519
|
}
|
|
6459
6520
|
}
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6521
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
6522
|
+
try {
|
|
6523
|
+
for(var _iterator1 = createDebug.names[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
6524
|
+
var ns = _step1.value;
|
|
6525
|
+
if (matchesTemplate(name, ns)) {
|
|
6526
|
+
return true;
|
|
6527
|
+
}
|
|
6528
|
+
}
|
|
6529
|
+
} catch (err) {
|
|
6530
|
+
_didIteratorError1 = true;
|
|
6531
|
+
_iteratorError1 = err;
|
|
6532
|
+
} finally{
|
|
6533
|
+
try {
|
|
6534
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
6535
|
+
_iterator1.return();
|
|
6536
|
+
}
|
|
6537
|
+
} finally{
|
|
6538
|
+
if (_didIteratorError1) {
|
|
6539
|
+
throw _iteratorError1;
|
|
6540
|
+
}
|
|
6463
6541
|
}
|
|
6464
6542
|
}
|
|
6465
6543
|
return false;
|
|
6466
6544
|
}
|
|
6467
|
-
/**
|
|
6468
|
-
* Convert regexp to namespace
|
|
6469
|
-
*
|
|
6470
|
-
* @param {RegExp} regxep
|
|
6471
|
-
* @return {String} namespace
|
|
6472
|
-
* @api private
|
|
6473
|
-
*/ function toNamespace(regexp) {
|
|
6474
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
6475
|
-
}
|
|
6476
6545
|
/**
|
|
6477
6546
|
* Coerce `val`.
|
|
6478
6547
|
*
|
|
@@ -6616,6 +6685,7 @@ function useColors() {
|
|
|
6616
6685
|
var m;
|
|
6617
6686
|
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
6618
6687
|
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
6688
|
+
// eslint-disable-next-line no-return-assign
|
|
6619
6689
|
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
6620
6690
|
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
6621
6691
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
@@ -7798,8 +7868,12 @@ var Agent = /*#__PURE__*/ function(_http_Agent) {
|
|
|
7798
7868
|
}).then(function(socket) {
|
|
7799
7869
|
_this.decrementSockets(name, fakeSocket);
|
|
7800
7870
|
if (_instanceof(socket, http.Agent)) {
|
|
7801
|
-
|
|
7802
|
-
|
|
7871
|
+
try {
|
|
7872
|
+
// @ts-expect-error `addRequest()` isn't defined in `@types/node`
|
|
7873
|
+
return socket.addRequest(req, connectOpts);
|
|
7874
|
+
} catch (err) {
|
|
7875
|
+
return cb(err);
|
|
7876
|
+
}
|
|
7803
7877
|
}
|
|
7804
7878
|
_this[INTERNAL].currentSocket = socket;
|
|
7805
7879
|
// @ts-expect-error `createSocket()` isn't defined in `@types/node`
|
|
@@ -8280,6 +8354,14 @@ var agent_base_1 = dist;
|
|
|
8280
8354
|
var url_1 = require$$3__default$1["default"];
|
|
8281
8355
|
var parse_proxy_response_1 = parseProxyResponse$1;
|
|
8282
8356
|
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
8357
|
+
var setServernameFromNonIpHost = function(options) {
|
|
8358
|
+
if (options.servername === undefined && options.host && !net.isIP(options.host)) {
|
|
8359
|
+
return _object_spread_props(_object_spread({}, options), {
|
|
8360
|
+
servername: options.host
|
|
8361
|
+
});
|
|
8362
|
+
}
|
|
8363
|
+
return options;
|
|
8364
|
+
};
|
|
8283
8365
|
/**
|
|
8284
8366
|
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
|
8285
8367
|
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
|
@@ -8328,7 +8410,7 @@ var debug = (0, debug_1.default)("https-proxy-agent");
|
|
|
8328
8410
|
*/ function connect(req, opts) {
|
|
8329
8411
|
var _this = this;
|
|
8330
8412
|
return _async_to_generator(function() {
|
|
8331
|
-
var proxy, socket,
|
|
8413
|
+
var proxy, socket, headers, host, payload, auth, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, name, proxyResponsePromise, _ref, connect, buffered, fakeSocket;
|
|
8332
8414
|
return _ts_generator(this, function(_state) {
|
|
8333
8415
|
switch(_state.label){
|
|
8334
8416
|
case 0:
|
|
@@ -8338,10 +8420,7 @@ var debug = (0, debug_1.default)("https-proxy-agent");
|
|
|
8338
8420
|
}
|
|
8339
8421
|
if (proxy.protocol === "https:") {
|
|
8340
8422
|
debug("Creating `tls.Socket`: %o", _this.connectOpts);
|
|
8341
|
-
|
|
8342
|
-
socket = tls.connect(_object_spread_props(_object_spread({}, _this.connectOpts), {
|
|
8343
|
-
servername: servername
|
|
8344
|
-
}));
|
|
8423
|
+
socket = tls.connect(setServernameFromNonIpHost(_this.connectOpts));
|
|
8345
8424
|
} else {
|
|
8346
8425
|
debug("Creating `net.Socket`: %o", _this.connectOpts);
|
|
8347
8426
|
socket = net.connect(_this.connectOpts);
|
|
@@ -8394,12 +8473,10 @@ var debug = (0, debug_1.default)("https-proxy-agent");
|
|
|
8394
8473
|
// The proxy is connecting to a TLS server, so upgrade
|
|
8395
8474
|
// this socket connection to a TLS connection.
|
|
8396
8475
|
debug("Upgrading socket connection to TLS");
|
|
8397
|
-
servername1 = opts.servername || opts.host;
|
|
8398
8476
|
return [
|
|
8399
8477
|
2,
|
|
8400
|
-
tls.connect(_object_spread_props(_object_spread({}, omit(opts, "host", "path", "port")), {
|
|
8401
|
-
socket: socket
|
|
8402
|
-
servername: servername1
|
|
8478
|
+
tls.connect(_object_spread_props(_object_spread({}, omit(setServernameFromNonIpHost(opts), "host", "path", "port")), {
|
|
8479
|
+
socket: socket
|
|
8403
8480
|
}))
|
|
8404
8481
|
];
|
|
8405
8482
|
}
|
package/index.esm.js
CHANGED
|
@@ -6394,20 +6394,69 @@ function setup(env) {
|
|
|
6394
6394
|
createDebug.namespaces = namespaces;
|
|
6395
6395
|
createDebug.names = [];
|
|
6396
6396
|
createDebug.skips = [];
|
|
6397
|
-
var
|
|
6398
|
-
var
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6397
|
+
var split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
6398
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
6399
|
+
try {
|
|
6400
|
+
for(var _iterator = split[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
6401
|
+
var ns = _step.value;
|
|
6402
|
+
if (ns[0] === "-") {
|
|
6403
|
+
createDebug.skips.push(ns.slice(1));
|
|
6404
|
+
} else {
|
|
6405
|
+
createDebug.names.push(ns);
|
|
6406
|
+
}
|
|
6403
6407
|
}
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6408
|
+
} catch (err) {
|
|
6409
|
+
_didIteratorError = true;
|
|
6410
|
+
_iteratorError = err;
|
|
6411
|
+
} finally{
|
|
6412
|
+
try {
|
|
6413
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6414
|
+
_iterator.return();
|
|
6415
|
+
}
|
|
6416
|
+
} finally{
|
|
6417
|
+
if (_didIteratorError) {
|
|
6418
|
+
throw _iteratorError;
|
|
6419
|
+
}
|
|
6420
|
+
}
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
/**
|
|
6424
|
+
* Checks if the given string matches a namespace template, honoring
|
|
6425
|
+
* asterisks as wildcards.
|
|
6426
|
+
*
|
|
6427
|
+
* @param {String} search
|
|
6428
|
+
* @param {String} template
|
|
6429
|
+
* @return {Boolean}
|
|
6430
|
+
*/ function matchesTemplate(search, template) {
|
|
6431
|
+
var searchIndex = 0;
|
|
6432
|
+
var templateIndex = 0;
|
|
6433
|
+
var starIndex = -1;
|
|
6434
|
+
var matchIndex = 0;
|
|
6435
|
+
while(searchIndex < search.length){
|
|
6436
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
6437
|
+
// Match character or proceed with wildcard
|
|
6438
|
+
if (template[templateIndex] === "*") {
|
|
6439
|
+
starIndex = templateIndex;
|
|
6440
|
+
matchIndex = searchIndex;
|
|
6441
|
+
templateIndex++; // Skip the '*'
|
|
6442
|
+
} else {
|
|
6443
|
+
searchIndex++;
|
|
6444
|
+
templateIndex++;
|
|
6445
|
+
}
|
|
6446
|
+
} else if (starIndex !== -1) {
|
|
6447
|
+
// Backtrack to the last '*' and try to match more characters
|
|
6448
|
+
templateIndex = starIndex + 1;
|
|
6449
|
+
matchIndex++;
|
|
6450
|
+
searchIndex = matchIndex;
|
|
6407
6451
|
} else {
|
|
6408
|
-
|
|
6452
|
+
return false; // No match
|
|
6409
6453
|
}
|
|
6410
6454
|
}
|
|
6455
|
+
// Handle trailing '*' in template
|
|
6456
|
+
while(templateIndex < template.length && template[templateIndex] === "*"){
|
|
6457
|
+
templateIndex++;
|
|
6458
|
+
}
|
|
6459
|
+
return templateIndex === template.length;
|
|
6411
6460
|
}
|
|
6412
6461
|
/**
|
|
6413
6462
|
* Disable debug output.
|
|
@@ -6415,7 +6464,7 @@ function setup(env) {
|
|
|
6415
6464
|
* @return {String} namespaces
|
|
6416
6465
|
* @api public
|
|
6417
6466
|
*/ function disable() {
|
|
6418
|
-
var namespaces = _to_consumable_array(createDebug.names
|
|
6467
|
+
var namespaces = _to_consumable_array(createDebug.names).concat(_to_consumable_array(createDebug.skips.map(function(namespace) {
|
|
6419
6468
|
return "-" + namespace;
|
|
6420
6469
|
}))).join(",");
|
|
6421
6470
|
createDebug.enable("");
|
|
@@ -6428,32 +6477,52 @@ function setup(env) {
|
|
|
6428
6477
|
* @return {Boolean}
|
|
6429
6478
|
* @api public
|
|
6430
6479
|
*/ function enabled(name) {
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6480
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
6481
|
+
try {
|
|
6482
|
+
for(var _iterator = createDebug.skips[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
6483
|
+
var skip = _step.value;
|
|
6484
|
+
if (matchesTemplate(name, skip)) {
|
|
6485
|
+
return false;
|
|
6486
|
+
}
|
|
6487
|
+
}
|
|
6488
|
+
} catch (err) {
|
|
6489
|
+
_didIteratorError = true;
|
|
6490
|
+
_iteratorError = err;
|
|
6491
|
+
} finally{
|
|
6492
|
+
try {
|
|
6493
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6494
|
+
_iterator.return();
|
|
6495
|
+
}
|
|
6496
|
+
} finally{
|
|
6497
|
+
if (_didIteratorError) {
|
|
6498
|
+
throw _iteratorError;
|
|
6499
|
+
}
|
|
6439
6500
|
}
|
|
6440
6501
|
}
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6502
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
6503
|
+
try {
|
|
6504
|
+
for(var _iterator1 = createDebug.names[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
6505
|
+
var ns = _step1.value;
|
|
6506
|
+
if (matchesTemplate(name, ns)) {
|
|
6507
|
+
return true;
|
|
6508
|
+
}
|
|
6509
|
+
}
|
|
6510
|
+
} catch (err) {
|
|
6511
|
+
_didIteratorError1 = true;
|
|
6512
|
+
_iteratorError1 = err;
|
|
6513
|
+
} finally{
|
|
6514
|
+
try {
|
|
6515
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
6516
|
+
_iterator1.return();
|
|
6517
|
+
}
|
|
6518
|
+
} finally{
|
|
6519
|
+
if (_didIteratorError1) {
|
|
6520
|
+
throw _iteratorError1;
|
|
6521
|
+
}
|
|
6444
6522
|
}
|
|
6445
6523
|
}
|
|
6446
6524
|
return false;
|
|
6447
6525
|
}
|
|
6448
|
-
/**
|
|
6449
|
-
* Convert regexp to namespace
|
|
6450
|
-
*
|
|
6451
|
-
* @param {RegExp} regxep
|
|
6452
|
-
* @return {String} namespace
|
|
6453
|
-
* @api private
|
|
6454
|
-
*/ function toNamespace(regexp) {
|
|
6455
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
6456
|
-
}
|
|
6457
6526
|
/**
|
|
6458
6527
|
* Coerce `val`.
|
|
6459
6528
|
*
|
|
@@ -6597,6 +6666,7 @@ function useColors() {
|
|
|
6597
6666
|
var m;
|
|
6598
6667
|
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
6599
6668
|
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
6669
|
+
// eslint-disable-next-line no-return-assign
|
|
6600
6670
|
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
6601
6671
|
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
6602
6672
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
@@ -7779,8 +7849,12 @@ var Agent = /*#__PURE__*/ function(_http_Agent) {
|
|
|
7779
7849
|
}).then(function(socket) {
|
|
7780
7850
|
_this.decrementSockets(name, fakeSocket);
|
|
7781
7851
|
if (_instanceof(socket, http.Agent)) {
|
|
7782
|
-
|
|
7783
|
-
|
|
7852
|
+
try {
|
|
7853
|
+
// @ts-expect-error `addRequest()` isn't defined in `@types/node`
|
|
7854
|
+
return socket.addRequest(req, connectOpts);
|
|
7855
|
+
} catch (err) {
|
|
7856
|
+
return cb(err);
|
|
7857
|
+
}
|
|
7784
7858
|
}
|
|
7785
7859
|
_this[INTERNAL].currentSocket = socket;
|
|
7786
7860
|
// @ts-expect-error `createSocket()` isn't defined in `@types/node`
|
|
@@ -8261,6 +8335,14 @@ var agent_base_1 = dist;
|
|
|
8261
8335
|
var url_1 = require$$3$1;
|
|
8262
8336
|
var parse_proxy_response_1 = parseProxyResponse$1;
|
|
8263
8337
|
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
8338
|
+
var setServernameFromNonIpHost = function(options) {
|
|
8339
|
+
if (options.servername === undefined && options.host && !net.isIP(options.host)) {
|
|
8340
|
+
return _object_spread_props(_object_spread({}, options), {
|
|
8341
|
+
servername: options.host
|
|
8342
|
+
});
|
|
8343
|
+
}
|
|
8344
|
+
return options;
|
|
8345
|
+
};
|
|
8264
8346
|
/**
|
|
8265
8347
|
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
|
8266
8348
|
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
|
@@ -8309,7 +8391,7 @@ var debug = (0, debug_1.default)("https-proxy-agent");
|
|
|
8309
8391
|
*/ function connect(req, opts) {
|
|
8310
8392
|
var _this = this;
|
|
8311
8393
|
return _async_to_generator(function() {
|
|
8312
|
-
var proxy, socket,
|
|
8394
|
+
var proxy, socket, headers, host, payload, auth, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, name, proxyResponsePromise, _ref, connect, buffered, fakeSocket;
|
|
8313
8395
|
return _ts_generator(this, function(_state) {
|
|
8314
8396
|
switch(_state.label){
|
|
8315
8397
|
case 0:
|
|
@@ -8319,10 +8401,7 @@ var debug = (0, debug_1.default)("https-proxy-agent");
|
|
|
8319
8401
|
}
|
|
8320
8402
|
if (proxy.protocol === "https:") {
|
|
8321
8403
|
debug("Creating `tls.Socket`: %o", _this.connectOpts);
|
|
8322
|
-
|
|
8323
|
-
socket = tls.connect(_object_spread_props(_object_spread({}, _this.connectOpts), {
|
|
8324
|
-
servername: servername
|
|
8325
|
-
}));
|
|
8404
|
+
socket = tls.connect(setServernameFromNonIpHost(_this.connectOpts));
|
|
8326
8405
|
} else {
|
|
8327
8406
|
debug("Creating `net.Socket`: %o", _this.connectOpts);
|
|
8328
8407
|
socket = net.connect(_this.connectOpts);
|
|
@@ -8375,12 +8454,10 @@ var debug = (0, debug_1.default)("https-proxy-agent");
|
|
|
8375
8454
|
// The proxy is connecting to a TLS server, so upgrade
|
|
8376
8455
|
// this socket connection to a TLS connection.
|
|
8377
8456
|
debug("Upgrading socket connection to TLS");
|
|
8378
|
-
servername1 = opts.servername || opts.host;
|
|
8379
8457
|
return [
|
|
8380
8458
|
2,
|
|
8381
|
-
tls.connect(_object_spread_props(_object_spread({}, omit(opts, "host", "path", "port")), {
|
|
8382
|
-
socket: socket
|
|
8383
|
-
servername: servername1
|
|
8459
|
+
tls.connect(_object_spread_props(_object_spread({}, omit(setServernameFromNonIpHost(opts), "host", "path", "port")), {
|
|
8460
|
+
socket: socket
|
|
8384
8461
|
}))
|
|
8385
8462
|
];
|
|
8386
8463
|
}
|