def block_instance(blocker: str, blocked: str, reason: str, block_level: str):
# DEBUG: print("DEBUG: blocker,blocked,reason,block_level:", blocker, blocked, reason, block_level)
- if not validators.domain(blocker):
+ if not validators.domain(blocker.split("/")[0]):
print("WARNING: Bad blocker:", blocker)
raise
- elif not validators.domain(blocked):
+ elif not validators.domain(blocked.split("/")[0]):
print("WARNING: Bad blocked:", blocked)
raise
def add_instance(domain: str, origin: str, originator: str):
# DEBUG: print("DEBUG: domain,origin:", domain, origin, originator)
- if not validators.domain(domain):
+ if not validators.domain(domain.split("/")[0]):
print("WARNING: Bad domain name:", domain)
raise
- elif origin is not None and not validators.domain(origin):
+ elif origin is not None and not validators.domain(origin.split("/")[0]):
print("WARNING: Bad origin name:", origin)
raise
if instance == "":
print("WARNING: Empty instance after tidyup(), domain:", domain)
continue
- elif not validators.domain(instance):
- print("WARNING: Bad instance name,domain:", instance, domain)
+ elif not validators.domain(instance.split("/")[0]):
+ print(f"WARNING: Bad instance='{domain} from domain='{domain}',origin='{origin}',software='{software}'")
continue
elif fba.is_blacklisted(instance):
# NOISY-DEBUG: print("DEBUG: instance is blacklisted:", instance)