Skip to content

Commit

Permalink
Ensure address is defined before checking against an excluded hostnam…
Browse files Browse the repository at this point in the history
…e prefix (#2)
  • Loading branch information
jonhaddow authored May 7, 2024
1 parent c1e2487 commit 0a53e43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cors_proxy.createServer({
'fe80::10'
];
dns.lookup(hostname, { hints: dns.ADDRCONFIG }, (err, address, family) => {
if (excludedHostnamePrefixes.some(p => address.startsWith(p))) {
if (address && excludedHostnamePrefixes.some(p => address.startsWith(p))) {
err = 'ExcludedAddress'
}
callback(err, address, family);
Expand Down

0 comments on commit 0a53e43

Please sign in to comment.