@@ -9740,18 +9740,6 @@ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
9740
9740
exports . debug = debug ; // for test
9741
9741
9742
9742
9743
- /***/ } ) ,
9744
-
9745
- /***/ 9026 :
9746
- /***/ ( ( __unused_webpack_module , exports ) => {
9747
-
9748
- "use strict" ;
9749
-
9750
- Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
9751
- // Used by buildProxyBypassRegexFromEnv for escaping dot symbols in NO_PROXY hosts' strings
9752
- exports . searchRegExpToReplaceSpecialChars = new RegExp ( '(?<!\\\\)([.])(?!\\*)' , 'g' ) ;
9753
-
9754
-
9755
9743
/***/ } ) ,
9756
9744
9757
9745
/***/ 5538 :
@@ -10508,7 +10496,6 @@ const qs = __nccwpck_require__(9615);
10508
10496
const url = __nccwpck_require__ ( 8835 ) ;
10509
10497
const path = __nccwpck_require__ ( 5622 ) ;
10510
10498
const zlib = __nccwpck_require__ ( 8761 ) ;
10511
- const Constants_1 = __nccwpck_require__ ( 9026 ) ;
10512
10499
/**
10513
10500
* creates an url from a request url and optional base url (http://server:8080)
10514
10501
* @param {string } resource - a fully qualified url or relative path
@@ -10600,13 +10587,17 @@ exports.decompressGzippedContent = decompressGzippedContent;
10600
10587
* @return {RegExp }
10601
10588
*/
10602
10589
function buildProxyBypassRegexFromEnv ( bypass ) {
10603
- // check if expression starts with asterisk and replace it with .*
10604
- if ( bypass && bypass . startsWith ( "*" ) ) {
10605
- bypass = bypass . replace ( "*" , ".*" ) ;
10590
+ try {
10591
+ // We need to keep this around for back-compat purposes
10592
+ return new RegExp ( bypass , 'i' ) ;
10593
+ }
10594
+ catch ( err ) {
10595
+ if ( err instanceof SyntaxError && ( bypass || "" ) . startsWith ( "*" ) ) {
10596
+ let wildcardEscaped = bypass . replace ( '*' , '(.*)' ) ;
10597
+ return new RegExp ( wildcardEscaped , 'i' ) ;
10598
+ }
10599
+ throw err ;
10606
10600
}
10607
- // replace all . symbols in string by \. because point is a special character
10608
- const safeRegex = ( bypass || "" ) . replace ( Constants_1 . searchRegExpToReplaceSpecialChars , '\\$1' ) ;
10609
- return new RegExp ( safeRegex , 'i' ) ;
10610
10601
}
10611
10602
exports . buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv ;
10612
10603
/**
0 commit comments