diff --git a/uwhoisd/__init__.py b/uwhoisd/__init__.py index 3d3820e..9ff88d2 100644 --- a/uwhoisd/__init__.py +++ b/uwhoisd/__init__.py @@ -222,6 +222,9 @@ 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 else: # Domain, strip hostname part if needed query, zone = self._strip_hostname(query) diff --git a/uwhoisd/net.py b/uwhoisd/net.py index 69554e7..eaf5de5 100644 --- a/uwhoisd/net.py +++ b/uwhoisd/net.py @@ -127,10 +127,11 @@ def on_connect(self): if self._timed_out: return whois_query = self.data.decode().strip().lower() - 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) + #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: logger.warning('Connection closed by %s.', self.client)