From 5a7ffd133a4a11d8fd701b4b4d65a033c81012a8 Mon Sep 17 00:00:00 2001 From: Andrei Date: Mon, 6 Feb 2023 14:45:34 +0200 Subject: [PATCH] fixed: .de with umlaut in both ASCII/Unicode --- src/whoiser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/whoiser.js b/src/whoiser.js index ae26349..eb2b7f4 100644 --- a/src/whoiser.js +++ b/src/whoiser.js @@ -120,8 +120,8 @@ const whoisTld = async (query, { timeout = 15000, raw = false, domainTld = '' } return data } -const whoisDomain = async (rawDomain, { host = null, timeout = 15000, follow = 2, raw = false, ignorePrivacy = true } = {}) => { - domain = punycode.toASCII(rawDomain) +const whoisDomain = async (domain, { host = null, timeout = 15000, follow = 2, raw = false, ignorePrivacy = true } = {}) => { + domain = punycode.toASCII(domain) const [domainName, domainTld] = splitStringBy(domain.toLowerCase(), domain.lastIndexOf('.')) let results = {} @@ -150,7 +150,7 @@ const whoisDomain = async (rawDomain, { host = null, timeout = 15000, follow = 2 // hardcoded WHOIS queries.. if (host === 'whois.denic.de') { - query = `-T dn ${rawDomain}` + query = `-T dn ${punycode.toUnicode(domain)}` } else if (host === 'whois.jprs.jp') { query = `${query}/e` }