Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #257 from maarten-boot/master
Browse files Browse the repository at this point in the history
add Malformed request to valid None return so that we retry one level up
  • Loading branch information
DannyCork authored Jan 23, 2023
2 parents fd6ebdd + d7cf297 commit d7dd9f1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions whois/_2_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ def handleShortResponse(
d = ".".join(dl)
print(f"line count < 5:: {tld} {d} {whois_str}", file=sys.stderr)

# TODO: some short responses are actually valid:
# lookfor Domain: and Status but all other fields are missing so the regexec could fail
# this domain is taken already or reserved

# whois syswow.64-b.it
# [Querying whois.nic.it]
# [whois.nic.it]
# Domain: syswow.64-b.it
# Status: UNASSIGNABLE

s = whois_str.strip().lower()

# NOTE: from here s is lowercase only
Expand All @@ -134,6 +144,7 @@ def handleShortResponse(
"status: available",
"no whois server is known for this kind of object",
"nameserver not found",
"malformed request", # this means this domain is not in whois as it is on top of a registered domain
]

for i in noneStrings:
Expand Down

0 comments on commit d7dd9f1

Please sign in to comment.