aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/dns.js
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-14 12:58:30 -0700
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-14 12:58:30 -0700
commitf9add8b6bea4df3cdbd56a21f17e4cab1a854e4e (patch)
tree8e5306104d81c67b771181337bba02cd9ec39453 /src/js/node/dns.js
parent81a1a58d66c598ea35c42453d0ba4c6341a940fc (diff)
parent9b5e66453b0879ed77b71dcdbe50e4efa184261e (diff)
downloadbun-sdl.tar.gz
bun-sdl.tar.zst
bun-sdl.zip
Merge branch 'main' into sdlsdl
Diffstat (limited to '')
-rw-r--r--src/js/node/dns.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/node/dns.js b/src/js/node/dns.js
index 2dc3895a2..e82e6a4b5 100644
--- a/src/js/node/dns.js
+++ b/src/js/node/dns.js
@@ -19,6 +19,16 @@ function lookup(domain, options, callback) {
options = { family: options };
}
+ if (domain !== domain || (typeof domain !== "number" && !domain)) {
+ console.warn(
+ `DeprecationWarning: The provided hostname "${String(
+ domain,
+ )}" is not a valid hostname, and is supported in the dns module solely for compatibility.`,
+ );
+ callback(null, null, 4);
+ return;
+ }
+
dns.lookup(domain, options).then(
res => {
res.sort((a, b) => a.family - b.family);