]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 8 Jul 2023 21:22:23 +0000 (23:22 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 8 Jul 2023 21:22:23 +0000 (23:22 +0200)
- some instances or honeypots may return empty (None in Python) link[href]
  entries
- you can run a honeypot and pay monthly domain fees for it, not my business,
  but at least format your /.well-known/nodeinfo properly!

fba/http/federation.py
fba/models/instances.py

index 74edbd7a9f9818c3d7ff753843f8ed1fde161dae..8cc59053a85971656c8a363e5d2fb3803b1af7fa 100644 (file)
@@ -347,11 +347,14 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict:
                     elif "href" not in link:
                         logger.warning("link[rel]='%s' has no element 'href' - SKIPPED!", link["rel"])
                         continue
+                    elif link["href"] is None:
+                        logger.debug("link[href] is None, link[rel]='%s' - SKIPPED!", link["rel"])
+                        continue
 
                     # Default is that 'href' has a complete URL, but some hosts don't send that
                     logger.debug("link[rel]='%s' matches niid='%s'", link["rel"], niid)
                     url = link["href"]
-                    components = urlparse(link["href"])
+                    components = urlparse(url)
 
                     logger.debug("components[%s]='%s'", type(components), components)
                     if components.scheme == "" and components.netloc == "":
@@ -363,6 +366,7 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict:
                         url = f"{components.scheme}://{domain}{components.path}"
                         components = urlparse(url)
 
+                    logger.debug("components.netloc[]='%s'", type(components.netloc))
                     if not utils.is_domain_wanted(components.netloc):
                         logger.debug("components.netloc='%s' is not wanted - SKIPPED!", components.netloc)
                         continue
@@ -397,7 +401,7 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict:
     return data
 
 def fetch_generator_from_path(domain: str, path: str = "/") -> str:
-    logger.debug("domain(%d)='%s',path='%s' - CALLED!", len(domain), domain, path)
+    logger.debug("domain='%s',path='%s' - CALLED!", domain, path)
     domain_helper.raise_on(domain)
 
     if not isinstance(path, str):
@@ -495,7 +499,7 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str:
     return software
 
 def determine_software(domain: str, path: str = None) -> str:
-    logger.debug("domain(%d)='%s',path='%s' - CALLED!", len(domain), domain, path)
+    logger.debug("domain='%s',path='%s' - CALLED!", domain, path)
     domain_helper.raise_on(domain)
 
     if not isinstance(path, str) and path is not None:
index 3c8433de9de910e36afa6d35313c8b7d1ce1dfbd..7968ff236007aa4d086266dca30a4b001cd5ed06 100644 (file)
@@ -431,7 +431,7 @@ def set_detection_mode(domain: str, mode: str):
     logger.debug("EXIT!")
 
 def set_has_obfuscation(domain: str, status: bool):
-    logger.debug("domain(%d)='%s',status='%s' - CALLED!", len(domain), domain, status)
+    logger.debug("domain='%s',status='%s' - CALLED!", domain, status)
     domain_helper.raise_on(domain)
 
     if not isinstance(status, bool):