]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 18 Jul 2024 22:16:38 +0000 (00:16 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 18 Jul 2024 22:16:38 +0000 (00:16 +0200)
- split off question mark (mostly comes from WordPress instances)

fba/helpers/domain.py
fba/http/federation.py

index f05604751a5d6f7c14a9af55b528a66c4ebd3207..6b0fd10b57a910d12b21e3f0d47dc1363b81da98 100644 (file)
@@ -122,7 +122,7 @@ def is_wanted(domain: str) -> bool:
 
 @lru_cache
 def encode_idna(domain: str) -> str:
-    logger.debug("domain='%s' - CALLED!")
+    logger.debug("domain='%s' - CALLED!", domain)
     raise_on(domain)
 
     punycode = domain.lstrip(".").split("?")[0]
index d62aca4b0430801d2891a02d7b3a82c8aea5f39c..ad10c0c8d742252cc2bd6fb028d5b7e77893287e 100644 (file)
@@ -171,25 +171,26 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path:
             logger.warning("instance='%s' contains double-dot, removing ...", instance)
             instance = instance.replace("..", ".")
 
-        logger.debug("instance='%s'", instance)
-        if not validators.domain(instance, rfc_2782=True):
-            logger.warning("instance='%s' is not a valid domain - SKIPPED!", instance)
+        probe = instance.split("/")[0]
+        logger.debug("instance='%s',probe='%s'", instance, probe)
+        if not validators.domain(probe, rfc_2782=True):
+            logger.warning("probe='%s' is not a valid domain - SKIPPED!", probe)
             continue
-        elif instance.endswith(".onion"):
-            logger.debug("instance='%s' is a TOR .onion instance - SKIPPED!", instance)
+        elif probe.endswith(".onion"):
+            logger.debug("probe='%s' is a TOR .onion probe - SKIPPED!", probe)
             continue
-        elif instance.endswith(".i2p") and not config.get("allow_i2p_domain"):
-            logger.debug("instance='%s' is an I2P .onion instance - SKIPPED!", instance)
+        elif probe.endswith(".i2p") and not config.get("allow_i2p_domain"):
+            logger.debug("probe='%s' is an I2P .onion probe - SKIPPED!", probe)
             continue
-        elif instance.endswith(".arpa"):
-            logger.debug("instance='%s' is a reverse IP address - SKIPPED!", instance)
+        elif probe.endswith(".arpa"):
+            logger.debug("probe='%s' is a reverse IP address - SKIPPED!", probe)
             continue
-        elif instance.endswith(".tld"):
-            logger.debug("instance='%s' is a fake instance - SKIPPED!", instance)
+        elif probe.endswith(".tld"):
+            logger.debug("probe='%s' is a fake probe - SKIPPED!", probe)
             continue
 
         logger.debug("instance='%s' - BEFORE!", instance)
-        instance = domain_helper.encode_idna(instance)
+        instance = domain_helper.encode_idna(instance.split("?")[0])
         logger.debug("instance='%s' - AFTER!", instance)
 
         if not domain_helper.is_wanted(instance):