fix: recognize CNNIC and DENIC throttle replies

"Queried interval is too short." (CNNIC) and DENIC's "access control limit
reached" weren't recognized, so a throttled .cn or .de lookup failed as
"unparseable" instead of "rate_limited". .cn has no RDAP, so its WHOIS
throttling was always misreported. The texts are from known registry replies,
not captured in this session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jakeandClaude Opus 5.5 committed 2026-10-03 15:35:45 -04:00
1 parent 9e0fc2be80
commit 7ee68be7cc
2 files changed
+4

No files matched your search

+2
View File
@@ -8,6 +8,8 @@ describe("detectWhoisRefusal", () => {
"You have exceeded the allowed number of queries.",
"Too many requests",
"<!DOCTYPE html><html><body>Service Unavailable</body></html>",
"Queried interval is too short.",
"% Error: 55000000002 Connection refused; access control limit reached.",
])("classifies %j as rate_limited", (text) => {
expect(detectWhoisRefusal(text)).toBe("rate_limited");
});
+2
View File
@@ -11,6 +11,8 @@ const THROTTLE_PATTERNS: RegExp[] = [
/quota\s+exceeded/i,
/exceeded\s+.{0,40}(quer|limit|request|connection)/i,
/too\s+many\s+(quer|request|connection)/i,
/queried interval is too short/i, // CNNIC
/access control limit/i, // DENIC: "Connection refused; access control limit reached"
/^\s*<(!doctype|html)\b/i,
];