]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 15 Sep 2024 16:03:34 +0000 (18:03 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 15 Sep 2024 16:03:34 +0000 (18:03 +0200)
- skip invalid domains after checking them for obfuscation with asterisks or
  question marks

fba/commands.py

index 4abf8b74518bce0df3597ddc8b8283e338ea075e..539aee336415e5d9a50cfb9fb3e7c9f074683e5f 100644 (file)
@@ -360,7 +360,7 @@ def fetch_blocks(args: argparse.Namespace) -> int:
         for block in blocking:
             logger.debug("blocked='%s',block_level='%s',reason='%s'", block["blocked"], block["block_level"], block["reason"])
 
-            if block["block_level"] == "":
+            if block["block_level"] in [None, ""]:
                 logger.warning("block_level is empty, blocker='%s',blocked='%s'", block["blocker"], block["blocked"])
                 continue
 
@@ -428,6 +428,9 @@ def fetch_blocks(args: argparse.Namespace) -> int:
                 block["blocked"] = row["domain"]
                 origin           = row["origin"]
                 nodeinfo_url     = row["nodeinfo_url"]
+            elif not validators.domain(block["blocked"], rfc_2782=True):
+                logger.warning("block[blocked]='%s' is not a valid domain - SKIPPED!", block["blocked"])
+                continue
 
             logger.debug("Looking up instance by domain, block[blocked]='%s'", block["blocked"])
             if block["blocked"] in [None, ""]: