fix: handle IPs, avoid wrong parent-domain lookups, cache whois results

- Bare IP addresses and non-domain hosts (localhost, IPv6) now return a
  null expiry instead of throwing, so they no longer spam error logs.
- Extract the registrable domain with tldts instead of walking up
  hostname labels, so a subdomain can never accidentally return its
  parent domain's expiry date.
- Cache WHOIS lookups per registrable domain (1h positive, 10min
  negative) so visiting details pages does not re-query the registry
  every time.

Addresses review feedback on #3834.
This commit is contained in:
colinjtsen2010 committed 2026-08-13 12:02:49 +08:00
1 parent e5959ca91d
commit 75516a220d
7 files changed
+160 -53

No files matched your search

+1
View File
@@ -63,6 +63,7 @@
"sharp": "0.33.5",
"ssl-checker": "2.0.10",
"swagger-ui-express": "5.0.1",
"tldts": "^7.4.10",
"whoiser": "^1.18.0",
"winston": "^3.13.0",
"ws": "^8.19.0",