mirror of
https://github.com/jakejarvis/rdapper.git
synced 2026-09-23 03:45:31 -04:00
Prefer TLD WHOIS over contradictory registrar referral; revert heuristic override and add referral test\n\n- Keep TLD response when registrar says ‘not found’\n- Revert WHOIS isRegistered to simple availability check\n- Add referral contradiction unit test for .io scenario\n- All tests passing
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { isWhoisAvailable } from "../lib/domain";
|
||||
import type { LookupOptions } from "../types";
|
||||
import type { WhoisQueryResult } from "./client";
|
||||
import { whoisQuery } from "./client";
|
||||
@@ -28,7 +29,14 @@ export async function followWhoisReferrals(
|
||||
visited.add(normalized);
|
||||
try {
|
||||
const res = await whoisQuery(next, domain, opts);
|
||||
current = res; // adopt the newer, more specific result
|
||||
// Prefer authoritative TLD response when registrar contradicts availability
|
||||
const registeredBefore = !isWhoisAvailable(current.text);
|
||||
const registeredAfter = !isWhoisAvailable(res.text);
|
||||
if (registeredBefore && !registeredAfter) {
|
||||
// Registrar claims availability but TLD shows registered: keep TLD
|
||||
break;
|
||||
}
|
||||
current = res; // adopt registrar when it does not downgrade registration
|
||||
} catch {
|
||||
// If referral server fails, stop following and keep the last good response
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user