fix: read the .tw registrar from "Registration Service Provider"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jakeandClaude Opus 5.5 committed 2026-10-03 14:53:56 -04:00
1 parent f654f1b3f7
commit b7539fe683
2 files changed
+10

No files matched your search

+8
View File
@@ -344,10 +344,18 @@ test("WHOIS .tw TWNIC 'Record ... on' sentence dates", () => {
" Domain servers in listed order:",
" dns1.twnic.net.tw 210.65.47.29 ",
"",
"Registration Service Provider: TWNIC",
"Registration Service URL: https://rs.twnic.tw/",
"Registrar Abuse Contact Email: abuse@twnic.tw",
].join("\n");
const rec = normalizeWhois("twnic.net.tw", "net.tw", text, "whois.twnic.net.tw");
expect(rec.creationDate).toBe("2000-02-02T07:06:48Z");
expect(rec.expirationDate).toBe("2099-12-31T15:59:59Z");
expect(rec.registrar).toMatchObject({
name: "TWNIC",
url: "https://rs.twnic.tw/",
email: "abuse@twnic.tw",
});
});
test("WHOIS header-style date whose value follows a blank line still parses", () => {
+2
View File
@@ -133,6 +133,7 @@ export function normalizeWhois(
"sponsoring registrar",
"organisation",
"record maintained by",
"registration service provider", // .tw
]);
const ianaId = anyValue(map, ["registrar iana id", "sponsoring registrar iana id", "iana id"]);
const url = anyValue(map, [
@@ -140,6 +141,7 @@ export function normalizeWhois(
"registrar website",
"registrar web", // .it
"url of the registrar",
"registration service url", // .tw
"referrer",
]);
const abuseEmail = anyValue(map, ["registrar abuse contact email", "abuse contact email"]);