From: Enju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com> Date: Fri, 22 Apr 2022 02:25:29 +0000 (+0200) Subject: use wildchar for domain X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5bbe09862ded1142a2d98427baff8933b045a04a;p=fba.git use wildchar for domain --- diff --git a/api.py b/api.py index 0b01a25..ffdb03e 100644 --- a/api.py +++ b/api.py @@ -22,7 +22,8 @@ def info(): def blocked(domain: str): conn = sqlite3.connect("blocks.db") c = conn.cursor() - c.execute("select blocker, block_level, reason from blocks where blocked = ?", (domain,)) + wildchar = "*." + ".".join(domain.split(".")[-domain.count("."):]) + c.execute("select blocker, block_level, reason from blocks where blocked = ? or blocked = ?", (domain, wildchar)) blocks = c.fetchall() conn.close()