From: Roland Häder Date: Wed, 10 Jul 2024 20:54:21 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7dd844225fd03f9228d76950165ffae212ab5084;p=fba.git Continued: - a warning was to much here - also need to check on other invalid TLDs, like .arpa, .tld and (if disabled) .onion/.i2p TLDs --- diff --git a/fba/http/federation.py b/fba/http/federation.py index 8b22ccf..cdffdf5 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -173,7 +173,19 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path: logger.debug("instance='%s'", instance) if not validators.domain(instance, rfc_2782=True): - logger.warning("instance='%s' is not a valid domain - SKIPPED!", instance) + logger.debug("instance='%s' is not a valid domain - SKIPPED!", instance) + continue + elif instance.endswith(".onion"): + logger.debug("instance='%s' is a TOR .onion instance - SKIPPED", instance) + continue + elif instance.endswith(".i2p") and not config.get("allow_i2p_instance"): + logger.debug("instance='%s' is an I2P .onion instance - SKIPPED", instance) + continue + elif instance.endswith(".arpa"): + logger.debug("instance='%s' is a reverse IP address - SKIPPED", instance) + continue + elif instance.endswith(".tld"): + logger.debug("instance='%s' is a fake instance - SKIPPED", instance) continue logger.debug("instance='%s' - BEFORE!", instance)