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

Commit d7dd9f1

Browse files
author
DannyCork
authored
Merge pull request #257 from maarten-boot/master
add Malformed request to valid None return so that we retry one level up
2 parents fd6ebdd + d7cf297 commit d7dd9f1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

whois/_2_parse.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ def handleShortResponse(
118118
d = ".".join(dl)
119119
print(f"line count < 5:: {tld} {d} {whois_str}", file=sys.stderr)
120120

121+
# TODO: some short responses are actually valid:
122+
# lookfor Domain: and Status but all other fields are missing so the regexec could fail
123+
# this domain is taken already or reserved
124+
125+
# whois syswow.64-b.it
126+
# [Querying whois.nic.it]
127+
# [whois.nic.it]
128+
# Domain: syswow.64-b.it
129+
# Status: UNASSIGNABLE
130+
121131
s = whois_str.strip().lower()
122132

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

139150
for i in noneStrings:

0 commit comments

Comments
 (0)