Skip to content

Commit 14ea63b

Browse files
committed
Allow to lookup NIC-handles
1 parent 3bd670e commit 14ea63b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

uwhoisd/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,11 @@ def whois(self, query: str) -> str:
222222
zone = 'ipv6'
223223
elif query.lower().startswith('as') and query.lower()[2:].isdigit():
224224
zone = 'asn'
225-
# if query is no ip, asn or fqdn
226225
elif not utils.is_well_formed_fqdn(query):
227-
zone = 'abuse-c' # what would be the correct zone for an abuse-c object
226+
# if query is no ip, asn or fqdn
227+
# it's probably a NIC handle (Network Information Centre handle)
228+
# probably an abuse-c object
229+
zone = 'NIC-handle'
228230
else:
229231
# Domain, strip hostname part if needed
230232
query, zone = self._strip_hostname(query)

uwhoisd/net.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ def on_connect(self):
127127
if self._timed_out:
128128
return
129129
whois_query = self.data.decode().strip().lower()
130-
#should all the chekcing be removed?
131-
#if not utils.is_well_formed_fqdn(whois_query) and ':' not in whois_query and not whois_query.lower().startswith('as'):
132-
# whois_entry = "; Bad request: '{0}'\r\n".format(whois_query)
133-
#else:
134130
whois_entry = self.query_fct(whois_query)
135131
yield self.stream.write(whois_entry.encode())
136132
except tornado.iostream.StreamClosedError:

0 commit comments

Comments
 (0)