mirror of
https://github.com/jakejarvis/rdapper.git
synced 2026-10-26 08:26:22 -04:00
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:
2 files changed
+4
No files matched your search
@@ -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");
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
];
|
||||
|
||||
|
||||
Reference in new issue
Block a user