Skip to content

Commit 48b9d35

Browse files
committed
is-ip
1 parent 96553e5 commit 48b9d35

File tree

3 files changed

+103
-13
lines changed

3 files changed

+103
-13
lines changed

lib/handlers/cors-proxy.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import cors from 'cors'
33
import debug from '../debug.mjs'
44
import url from 'url'
55
import dns from 'dns'
6-
import isIp from 'is-ip'
6+
import { isIP } from 'is-ip'
77
import ipRange from 'ip-range-check'
88
import validUrl from 'valid-url'
99

@@ -73,7 +73,7 @@ function extractProxyConfig (req, res, next) {
7373

7474
// Parse the URL and retrieve its host's IP address
7575
const { protocol, host, hostname, path } = url.parse(uri)
76-
if (isIp(hostname)) {
76+
if (isIP(hostname)) {
7777
addProxyConfig(null, hostname)
7878
} else {
7979
dns.lookup(hostname, addProxyConfig)

package-lock.json

Lines changed: 100 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"inquirer": "^8.2.7",
9595
"into-stream": "^5.1.1",
9696
"ip-range-check": "0.2.0",
97-
"is-ip": "^2.0.0",
97+
"is-ip": "^5.0.1",
9898
"li": "^1.3.0",
9999
"mashlib": "^2.0.0",
100100
"mime-types": "^3.0.2",

0 commit comments

Comments
 (0)