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
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, ""]: