Skip to content

Commit

Permalink
Allow to lookup NIC-handles
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoniaBK committed Apr 8, 2024
1 parent 3bd670e commit 14ea63b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions uwhoisd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ def whois(self, query: str) -> str:
zone = 'ipv6'
elif query.lower().startswith('as') and query.lower()[2:].isdigit():
zone = 'asn'
# if query is no ip, asn or fqdn
elif not utils.is_well_formed_fqdn(query):
zone = 'abuse-c' # what would be the correct zone for an abuse-c object
# if query is no ip, asn or fqdn
# it's probably a NIC handle (Network Information Centre handle)
# probably an abuse-c object
zone = 'NIC-handle'
else:
# Domain, strip hostname part if needed
query, zone = self._strip_hostname(query)
Expand Down
4 changes: 0 additions & 4 deletions uwhoisd/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ def on_connect(self):
if self._timed_out:
return
whois_query = self.data.decode().strip().lower()
#should all the chekcing be removed?
#if not utils.is_well_formed_fqdn(whois_query) and ':' not in whois_query and not whois_query.lower().startswith('as'):
# whois_entry = "; Bad request: '{0}'\r\n".format(whois_query)
#else:
whois_entry = self.query_fct(whois_query)
yield self.stream.write(whois_entry.encode())
except tornado.iostream.StreamClosedError:
Expand Down

0 comments on commit 14ea63b

Please sign in to comment.