@@ -3449,6 +3449,10 @@ function checkBypass(reqUrl) {
3449
3449
if (!reqUrl.hostname) {
3450
3450
return false;
3451
3451
}
3452
+ const reqHost = reqUrl.hostname;
3453
+ if (isLoopbackAddress(reqHost)) {
3454
+ return true;
3455
+ }
3452
3456
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
3453
3457
if (!noProxy) {
3454
3458
return false;
@@ -3474,13 +3478,24 @@ function checkBypass(reqUrl) {
3474
3478
.split(',')
3475
3479
.map(x => x.trim().toUpperCase())
3476
3480
.filter(x => x)) {
3477
- if (upperReqHosts.some(x => x === upperNoProxyItem)) {
3481
+ if (upperNoProxyItem === '*' ||
3482
+ upperReqHosts.some(x => x === upperNoProxyItem ||
3483
+ x.endsWith(`.${upperNoProxyItem}`) ||
3484
+ (upperNoProxyItem.startsWith('.') &&
3485
+ x.endsWith(`${upperNoProxyItem}`)))) {
3478
3486
return true;
3479
3487
}
3480
3488
}
3481
3489
return false;
3482
3490
}
3483
3491
exports.checkBypass = checkBypass;
3492
+ function isLoopbackAddress(host) {
3493
+ const hostLower = host.toLowerCase();
3494
+ return (hostLower === 'localhost' ||
3495
+ hostLower.startsWith('127.') ||
3496
+ hostLower.startsWith('[::1]') ||
3497
+ hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
3498
+ }
3484
3499
//# sourceMappingURL=proxy.js.map
3485
3500
3486
3501
/***/ }),
@@ -3520,11 +3535,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3520
3535
};
3521
3536
var _a;
3522
3537
Object.defineProperty(exports, "__esModule", ({ value: true }));
3523
- exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
3538
+ exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports. IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports. rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
3524
3539
const fs = __importStar(__nccwpck_require__(7147));
3525
3540
const path = __importStar(__nccwpck_require__(1017));
3526
- _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
3541
+ _a = fs.promises
3542
+ // export const {open} = 'fs'
3543
+ , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
3544
+ // export const {open} = 'fs'
3527
3545
exports.IS_WINDOWS = process.platform === 'win32';
3546
+ // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
3547
+ exports.UV_FS_O_EXLOCK = 0x10000000;
3548
+ exports.READONLY = fs.constants.O_RDONLY;
3528
3549
function exists(fsPath) {
3529
3550
return __awaiter(this, void 0, void 0, function* () {
3530
3551
try {
@@ -3705,12 +3726,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3705
3726
Object.defineProperty(exports, "__esModule", ({ value: true }));
3706
3727
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
3707
3728
const assert_1 = __nccwpck_require__(9491);
3708
- const childProcess = __importStar(__nccwpck_require__(2081));
3709
3729
const path = __importStar(__nccwpck_require__(1017));
3710
- const util_1 = __nccwpck_require__(3837);
3711
3730
const ioUtil = __importStar(__nccwpck_require__(1962));
3712
- const exec = util_1.promisify(childProcess.exec);
3713
- const execFile = util_1.promisify(childProcess.execFile);
3714
3731
/**
3715
3732
* Copies a file or folder.
3716
3733
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
@@ -3791,61 +3808,23 @@ exports.mv = mv;
3791
3808
function rmRF(inputPath) {
3792
3809
return __awaiter(this, void 0, void 0, function* () {
3793
3810
if (ioUtil.IS_WINDOWS) {
3794
- // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
3795
- // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
3796
3811
// Check for invalid characters
3797
3812
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
3798
3813
if (/[*"<>|]/.test(inputPath)) {
3799
3814
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
3800
3815
}
3801
- try {
3802
- const cmdPath = ioUtil.getCmdPath();
3803
- if (yield ioUtil.isDirectory(inputPath, true)) {
3804
- yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
3805
- env: { inputPath }
3806
- });
3807
- }
3808
- else {
3809
- yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
3810
- env: { inputPath }
3811
- });
3812
- }
3813
- }
3814
- catch (err) {
3815
- // if you try to delete a file that doesn't exist, desired result is achieved
3816
- // other errors are valid
3817
- if (err.code !== 'ENOENT')
3818
- throw err;
3819
- }
3820
- // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
3821
- try {
3822
- yield ioUtil.unlink(inputPath);
3823
- }
3824
- catch (err) {
3825
- // if you try to delete a file that doesn't exist, desired result is achieved
3826
- // other errors are valid
3827
- if (err.code !== 'ENOENT')
3828
- throw err;
3829
- }
3830
3816
}
3831
- else {
3832
- let isDir = false;
3833
- try {
3834
- isDir = yield ioUtil.isDirectory(inputPath);
3835
- }
3836
- catch (err) {
3837
- // if you try to delete a file that doesn't exist, desired result is achieved
3838
- // other errors are valid
3839
- if (err.code !== 'ENOENT')
3840
- throw err;
3841
- return;
3842
- }
3843
- if (isDir) {
3844
- yield execFile(`rm`, [`-rf`, `${inputPath}`]);
3845
- }
3846
- else {
3847
- yield ioUtil.unlink(inputPath);
3848
- }
3817
+ try {
3818
+ // note if path does not exist, error is silent
3819
+ yield ioUtil.rm(inputPath, {
3820
+ force: true,
3821
+ maxRetries: 3,
3822
+ recursive: true,
3823
+ retryDelay: 300
3824
+ });
3825
+ }
3826
+ catch (err) {
3827
+ throw new Error(`File was unable to be removed ${err}`);
3849
3828
}
3850
3829
});
3851
3830
}
0 commit comments