From 726b81b19251674e149ccfbb1abacbd837fc6db0 Mon Sep 17 00:00:00 2001 From: LinuxWizard42 Date: Wed, 12 Oct 2022 23:08:57 +0300 Subject: Removed files that should not have been included in git --- .../src/utilities/isUrlMatchingNoProxy.js | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 node_modules/global-agent/src/utilities/isUrlMatchingNoProxy.js (limited to 'node_modules/global-agent/src/utilities/isUrlMatchingNoProxy.js') diff --git a/node_modules/global-agent/src/utilities/isUrlMatchingNoProxy.js b/node_modules/global-agent/src/utilities/isUrlMatchingNoProxy.js deleted file mode 100644 index f2de584..0000000 --- a/node_modules/global-agent/src/utilities/isUrlMatchingNoProxy.js +++ /dev/null @@ -1,37 +0,0 @@ -// @flow - -import { - parse as parseUrl, -} from 'url'; -import matcher from 'matcher'; -import { - UnexpectedStateError, -} from '../errors'; - -export default (subjectUrl: string, noProxy: string) => { - const subjectUrlTokens = parseUrl(subjectUrl); - - const rules = noProxy.split(/[\s,]+/); - - for (const rule of rules) { - const ruleMatch = rule - .replace(/^(?\.)/, '*') - .match(/^(?.+?)(?::(?\d+))?$/); - - if (!ruleMatch || !ruleMatch.groups) { - throw new UnexpectedStateError('Invalid NO_PROXY pattern.'); - } - - if (!ruleMatch.groups.hostname) { - throw new UnexpectedStateError('NO_PROXY entry pattern must include hostname. Use * to match any hostname.'); - } - - const hostnameIsMatch = matcher.isMatch(subjectUrlTokens.hostname, ruleMatch.groups.hostname); - - if (hostnameIsMatch && (!ruleMatch.groups || !ruleMatch.groups.port || subjectUrlTokens.port && subjectUrlTokens.port === ruleMatch.groups.port)) { - return true; - } - } - - return false; -}; -- cgit v1.2.3-86-g962b