Skip to content

Commit 0b87b1a

Browse files
lpincaMylesBorins
authored andcommitted
dns: tweak regex for IPv6 addresses
The regex used in `dns.setServers()` to match IPv6 addresses in square brackets uses a capturing group for the port but this info is not needed. This commit replaces the capturing group with a non capturing one. Ref: #8965 PR-URL: #8665 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 2b01bc8 commit 0b87b1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dns.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ exports.setServers = function(servers) {
292292
if (ver)
293293
return newSet.push([ver, serv]);
294294

295-
var match = serv.match(/\[(.*)\](:\d+)?/);
295+
var match = serv.match(/\[(.*)\](?::\d+)?/);
296296

297297
// we have an IPv6 in brackets
298298
if (match) {

0 commit comments

Comments
 (0)