Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
lpinca committed Sep 20, 2016
commit 4c463d2594d777be4cc3b9ab4d879491261dbd16
2 changes: 1 addition & 1 deletion lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ exports.setServers = function(servers) {
if (ipVersion !== 0)
return [ipVersion, serv];

const match = serv.match(/\[(.*)\](:\d+)?/);
const match = serv.match(/\[(.*)\](?::\d+)?/);
// we have an IPv6 in brackets
if (match) {
ipVersion = isIP(match[1]);
Expand Down