summaryrefslogtreecommitdiff
path: root/node_modules/global-agent/dist/utilities/isUrlMatchingNoProxy.js.flow
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/global-agent/dist/utilities/isUrlMatchingNoProxy.js.flow
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/global-agent/dist/utilities/isUrlMatchingNoProxy.js.flow')
-rw-r--r--node_modules/global-agent/dist/utilities/isUrlMatchingNoProxy.js.flow37
1 files changed, 0 insertions, 37 deletions
diff --git a/node_modules/global-agent/dist/utilities/isUrlMatchingNoProxy.js.flow b/node_modules/global-agent/dist/utilities/isUrlMatchingNoProxy.js.flow
deleted file mode 100644
index f2de584..0000000
--- a/node_modules/global-agent/dist/utilities/isUrlMatchingNoProxy.js.flow
+++ /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(/^(?<leadingDot>\.)/, '*')
- .match(/^(?<hostname>.+?)(?::(?<port>\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;
-};