global-agent 2.1.12 → 2.2.0
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/README.md
CHANGED
|
@@ -79,7 +79,7 @@ This is useful if you need to conditionally bootstrap `global-agent`, e.g.
|
|
|
79
79
|
import {
|
|
80
80
|
bootstrap
|
|
81
81
|
} from 'global-agent';
|
|
82
|
-
import
|
|
82
|
+
import globalTunnel from 'global-tunnel-ng';
|
|
83
83
|
|
|
84
84
|
const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10);
|
|
85
85
|
|
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
|
|
16
16
|
const isUrlMatchingNoProxy = (subjectUrl, noProxy) => {
|
|
17
17
|
const subjectUrlTokens = (0, _url.parse)(subjectUrl);
|
|
18
|
-
const rules = noProxy.split(/[\s,]
|
|
18
|
+
const rules = noProxy.split(/[\s,]+/);
|
|
19
19
|
|
|
20
20
|
for (const rule of rules) {
|
|
21
21
|
const ruleMatch = rule.replace(/^(?<leadingDot>\.)/, '*').match(/^(?<hostname>.+?)(?::(?<port>\d+))?$/);
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
export default (subjectUrl: string, noProxy: string) => {
|
|
12
12
|
const subjectUrlTokens = parseUrl(subjectUrl);
|
|
13
13
|
|
|
14
|
-
const rules = noProxy.split(/[\s,]
|
|
14
|
+
const rules = noProxy.split(/[\s,]+/);
|
|
15
15
|
|
|
16
16
|
for (const rule of rules) {
|
|
17
17
|
const ruleMatch = rule
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/isUrlMatchingNoProxy.js"],"names":["subjectUrl","noProxy","subjectUrlTokens","rules","split","rule","ruleMatch","replace","match","groups","UnexpectedStateError","hostname","hostnameIsMatch","matcher","isMatch","port"],"mappings":";;;;;;;AAEA;;AAGA;;AACA;;;;8BAIgBA,U,EAAoBC,O,KAAoB;AACtD,QAAMC,gBAAgB,GAAG,gBAASF,UAAT,CAAzB;AAEA,QAAMG,KAAK,GAAGF,OAAO,CAACG,KAAR,CAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/isUrlMatchingNoProxy.js"],"names":["subjectUrl","noProxy","subjectUrlTokens","rules","split","rule","ruleMatch","replace","match","groups","UnexpectedStateError","hostname","hostnameIsMatch","matcher","isMatch","port"],"mappings":";;;;;;;AAEA;;AAGA;;AACA;;;;8BAIgBA,U,EAAoBC,O,KAAoB;AACtD,QAAMC,gBAAgB,GAAG,gBAASF,UAAT,CAAzB;AAEA,QAAMG,KAAK,GAAGF,OAAO,CAACG,KAAR,CAAc,QAAd,CAAd;;AAEA,OAAK,MAAMC,IAAX,IAAmBF,KAAnB,EAA0B;AACxB,UAAMG,SAAS,GAAGD,IAAI,CACnBE,OADe,CACP,oBADO,EACe,GADf,EAEfC,KAFe,CAET,sCAFS,CAAlB;;AAIA,QAAI,CAACF,SAAD,IAAc,CAACA,SAAS,CAACG,MAA7B,EAAqC;AACnC,YAAM,IAAIC,4BAAJ,CAAyB,2BAAzB,CAAN;AACD;;AAED,QAAI,CAACJ,SAAS,CAACG,MAAV,CAAiBE,QAAtB,EAAgC;AAC9B,YAAM,IAAID,4BAAJ,CAAyB,4EAAzB,CAAN;AACD;;AAED,UAAME,eAAe,GAAGC,iBAAQC,OAAR,CAAgBZ,gBAAgB,CAACS,QAAjC,EAA2CL,SAAS,CAACG,MAAV,CAAiBE,QAA5D,CAAxB;;AAEA,QAAIC,eAAe,KAAK,CAACN,SAAS,CAACG,MAAX,IAAqB,CAACH,SAAS,CAACG,MAAV,CAAiBM,IAAvC,IAA+Cb,gBAAgB,CAACa,IAAjB,IAAyBb,gBAAgB,CAACa,IAAjB,KAA0BT,SAAS,CAACG,MAAV,CAAiBM,IAAxH,CAAnB,EAAkJ;AAChJ,aAAO,IAAP;AACD;AACF;;AAED,SAAO,KAAP;AACD,C","sourcesContent":["// @flow\n\nimport {\n parse as parseUrl,\n} from 'url';\nimport matcher from 'matcher';\nimport {\n UnexpectedStateError,\n} from '../errors';\n\nexport default (subjectUrl: string, noProxy: string) => {\n const subjectUrlTokens = parseUrl(subjectUrl);\n\n const rules = noProxy.split(/[\\s,]+/);\n\n for (const rule of rules) {\n const ruleMatch = rule\n .replace(/^(?<leadingDot>\\.)/, '*')\n .match(/^(?<hostname>.+?)(?::(?<port>\\d+))?$/);\n\n if (!ruleMatch || !ruleMatch.groups) {\n throw new UnexpectedStateError('Invalid NO_PROXY pattern.');\n }\n\n if (!ruleMatch.groups.hostname) {\n throw new UnexpectedStateError('NO_PROXY entry pattern must include hostname. Use * to match any hostname.');\n }\n\n const hostnameIsMatch = matcher.isMatch(subjectUrlTokens.hostname, ruleMatch.groups.hostname);\n\n if (hostnameIsMatch && (!ruleMatch.groups || !ruleMatch.groups.port || subjectUrlTokens.port && subjectUrlTokens.port === ruleMatch.groups.port)) {\n return true;\n }\n }\n\n return false;\n};\n"],"file":"isUrlMatchingNoProxy.js"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
export default (subjectUrl: string, noProxy: string) => {
|
|
12
12
|
const subjectUrlTokens = parseUrl(subjectUrl);
|
|
13
13
|
|
|
14
|
-
const rules = noProxy.split(/[\s,]
|
|
14
|
+
const rules = noProxy.split(/[\s,]+/);
|
|
15
15
|
|
|
16
16
|
for (const rule of rules) {
|
|
17
17
|
const ruleMatch = rule
|