File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -192,17 +192,16 @@ class ProxyConfig {
192192 if ( entry . startsWith ( '*.' ) && host . endsWith ( entry . substring ( 1 ) ) ) return false ;
193193
194194 // Handle IP ranges (simple format like 192.168.1.0-192.168.1.255)
195- // TODO(joyeecheung): support IPv6.
196195 if ( entry . includes ( '-' ) ) {
197196 let { 0 : startIP , 1 : endIP } = entry . split ( '-' ) ;
198197 startIP = startIP . trim ( ) ;
199198 endIP = endIP . trim ( ) ;
200- if ( isIPv4 ( startIP ) && isIPv4 ( endIP ) && isIPv4 ( host ) ) {
199+ if ( startIP && endIP && isIPv4 ( startIP ) && isIPv4 ( endIP ) && isIPv4 ( host ) ) {
201200 const hostInt = ipToInt ( host ) ;
202201 const startInt = ipToInt ( startIP ) ;
203202 const endInt = ipToInt ( endIP ) ;
204203 if ( hostInt >= startInt && hostInt <= endInt ) return false ;
205- } else if ( isIPv6 ( startIP ) && isIPv6 ( endIP ) && isIPv6 ( host ) ) {
204+ } else if ( startIP && endIP && isIPv6 ( startIP ) && isIPv6 ( endIP ) && isIPv6 ( host ) ) {
206205 const hostInt = ipv6ToBigInt ( host ) ;
207206 const startInt = ipv6ToBigInt ( startIP ) ;
208207 const endInt = ipv6ToBigInt ( endIP ) ;
You can’t perform that action at this time.
0 commit comments