-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lib): user ipaddr.js instead of ip
- Fix to handle IPv6 address like IPv4-mapped IPv6 addresses
- Loading branch information
Showing
4 changed files
with
38 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,6 @@ | |
"typescript": "^3.5.3" | ||
}, | ||
"dependencies": { | ||
"ip": "^1.1.5" | ||
"ipaddr.js": "^1.9.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,12 @@ describe("request-filtering-agent", function() { | |
const privateIPs = [ | ||
`http://0.0.0.0:${TEST_PORT}`, // 0.0.0.0 is special | ||
`http://127.0.0.1:${TEST_PORT}`, // | ||
`http://[email protected]:${TEST_PORT}` // | ||
`http://[email protected]:${TEST_PORT}`, // | ||
`http://[::1]:${TEST_PORT}`, // IPv6 | ||
`http://[0:0:0:0:0:0:0:1]:${TEST_PORT}`, // IPv6 explicitly | ||
`http://[0:0:0:0:0:ffff:127.0.0.1]:${TEST_PORT}`, // IPv4-mapped IPv6 addresses | ||
`http://[::ffff:127.0.0.1]:${TEST_PORT}`, // IPv4-mapped IPv6 addresses | ||
`http://[::ffff:7f00:1]:${TEST_PORT}`, // IPv4-mapped IPv6 addresses | ||
]; | ||
for (const ipAddress of privateIPs) { | ||
try { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters