We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d39030 commit d6f31dcCopy full SHA for d6f31dc
lib/internal/socketaddress.js
@@ -157,7 +157,7 @@ class SocketAddress {
157
hostname: address,
158
port,
159
} = URLParse(`http://${input}`);
160
- if (address.startsWith('[') && address.endsWith(']')) {
+ if (address[0] === '[' && address[address.length - 1] === ']') {
161
return new SocketAddress({
162
address: address.slice(1, -1),
163
port: port | 0,
0 commit comments