Ignore self calls to nodeinfo

main
Bob Mottram 2022-01-30 15:13:00 +00:00
parent 220e04283a
commit cda6632973
1 changed files with 3 additions and 0 deletions

View File

@ -1134,6 +1134,9 @@ class PubServer(BaseHTTPRequestHandler):
def _nodeinfo(self, ua_str: str, calling_domain: str) -> bool: def _nodeinfo(self, ua_str: str, calling_domain: str) -> bool:
if not self.path.startswith('/nodeinfo/2.0'): if not self.path.startswith('/nodeinfo/2.0'):
return False return False
if calling_domain == self.server.domain_full:
self._404()
return True
if self.server.debug: if self.server.debug:
print('DEBUG: nodeinfo ' + self.path) print('DEBUG: nodeinfo ' + self.path)
self._update_known_crawlers(ua_str) self._update_known_crawlers(ua_str)