@@ -1616,7 +1616,6 @@ const core_1 = __nccwpck_require__(767);
1616
1616
const plugin_paginate_rest_1 = __nccwpck_require__(3779);
1617
1617
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(9210);
1618
1618
const plugin_throttling_1 = __nccwpck_require__(6856);
1619
- const proxy_from_env_1 = __nccwpck_require__(7777);
1620
1619
const proxy_1 = __nccwpck_require__(3459);
1621
1620
exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_throttling_1.throttling, autoProxyAgent);
1622
1621
exports.throttleOptions = {
@@ -1636,10 +1635,7 @@ exports.throttleOptions = {
1636
1635
// Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy
1637
1636
function autoProxyAgent(octokit) {
1638
1637
octokit.hook.before('request', options => {
1639
- const proxy = (0, proxy_from_env_1.getProxyForUrl)(options.baseUrl);
1640
- if (proxy) {
1641
- options.request.fetch = (0, proxy_1.createFetch)(proxy);
1642
- }
1638
+ options.request.fetch = proxy_1.fetch;
1643
1639
});
1644
1640
}
1645
1641
@@ -28666,122 +28662,6 @@ function copyFile(srcFile, destFile, force) {
28666
28662
})));
28667
28663
28668
28664
28669
- /***/ }),
28670
-
28671
- /***/ 7777:
28672
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
28673
-
28674
- "use strict";
28675
-
28676
-
28677
- var parseUrl = (__nccwpck_require__(7016).parse);
28678
-
28679
- var DEFAULT_PORTS = {
28680
- ftp: 21,
28681
- gopher: 70,
28682
- http: 80,
28683
- https: 443,
28684
- ws: 80,
28685
- wss: 443,
28686
- };
28687
-
28688
- var stringEndsWith = String.prototype.endsWith || function(s) {
28689
- return s.length <= this.length &&
28690
- this.indexOf(s, this.length - s.length) !== -1;
28691
- };
28692
-
28693
- /**
28694
- * @param {string|object} url - The URL, or the result from url.parse.
28695
- * @return {string} The URL of the proxy that should handle the request to the
28696
- * given URL. If no proxy is set, this will be an empty string.
28697
- */
28698
- function getProxyForUrl(url) {
28699
- var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {};
28700
- var proto = parsedUrl.protocol;
28701
- var hostname = parsedUrl.host;
28702
- var port = parsedUrl.port;
28703
- if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
28704
- return ''; // Don't proxy URLs without a valid scheme or host.
28705
- }
28706
-
28707
- proto = proto.split(':', 1)[0];
28708
- // Stripping ports in this way instead of using parsedUrl.hostname to make
28709
- // sure that the brackets around IPv6 addresses are kept.
28710
- hostname = hostname.replace(/:\d*$/, '');
28711
- port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
28712
- if (!shouldProxy(hostname, port)) {
28713
- return ''; // Don't proxy URLs that match NO_PROXY.
28714
- }
28715
-
28716
- var proxy =
28717
- getEnv('npm_config_' + proto + '_proxy') ||
28718
- getEnv(proto + '_proxy') ||
28719
- getEnv('npm_config_proxy') ||
28720
- getEnv('all_proxy');
28721
- if (proxy && proxy.indexOf('://') === -1) {
28722
- // Missing scheme in proxy, default to the requested URL's scheme.
28723
- proxy = proto + '://' + proxy;
28724
- }
28725
- return proxy;
28726
- }
28727
-
28728
- /**
28729
- * Determines whether a given URL should be proxied.
28730
- *
28731
- * @param {string} hostname - The host name of the URL.
28732
- * @param {number} port - The effective port of the URL.
28733
- * @returns {boolean} Whether the given URL should be proxied.
28734
- * @private
28735
- */
28736
- function shouldProxy(hostname, port) {
28737
- var NO_PROXY =
28738
- (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();
28739
- if (!NO_PROXY) {
28740
- return true; // Always proxy if NO_PROXY is not set.
28741
- }
28742
- if (NO_PROXY === '*') {
28743
- return false; // Never proxy if wildcard is set.
28744
- }
28745
-
28746
- return NO_PROXY.split(/[,\s]/).every(function(proxy) {
28747
- if (!proxy) {
28748
- return true; // Skip zero-length hosts.
28749
- }
28750
- var parsedProxy = proxy.match(/^(.+):(\d+)$/);
28751
- var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
28752
- var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
28753
- if (parsedProxyPort && parsedProxyPort !== port) {
28754
- return true; // Skip if ports don't match.
28755
- }
28756
-
28757
- if (!/^[.*]/.test(parsedProxyHostname)) {
28758
- // No wildcards, so stop proxying if there is an exact match.
28759
- return hostname !== parsedProxyHostname;
28760
- }
28761
-
28762
- if (parsedProxyHostname.charAt(0) === '*') {
28763
- // Remove leading wildcard.
28764
- parsedProxyHostname = parsedProxyHostname.slice(1);
28765
- }
28766
- // Stop proxying if the hostname ends with the no_proxy host.
28767
- return !stringEndsWith.call(hostname, parsedProxyHostname);
28768
- });
28769
- }
28770
-
28771
- /**
28772
- * Get the value for an environment variable.
28773
- *
28774
- * @param {string} key - The name of the environment variable.
28775
- * @return {string} The value of the environment variable.
28776
- * @private
28777
- */
28778
- function getEnv(key) {
28779
- return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
28780
- }
28781
-
28782
- exports.getProxyForUrl = getProxyForUrl;
28783
-
28784
-
28785
28665
/***/ }),
28786
28666
28787
28667
/***/ 770:
0 commit comments