From: Mint <> Date: Sun, 7 Aug 2022 07:21:22 +0000 (+0300) Subject: Return wildcard blocks for second-level domains as well X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b3fa2f5b4a866dd7fada728766686b005aff14e6;p=fba.git Return wildcard blocks for second-level domains as well --- diff --git a/api.py b/api.py index 440e48a..f099755 100644 --- a/api.py +++ b/api.py @@ -38,7 +38,7 @@ def blocked(domain: str = None, reason: str = None): c = conn.cursor() if domain != None: wildchar = "*." + ".".join(domain.split(".")[-domain.count("."):]) - c.execute("select blocker, block_level, reason from blocks where blocked = ? or blocked = ? or blocked = ?", (domain, wildchar, get_hash(domain))) + c.execute("select blocker, block_level, reason from blocks where blocked = ? or blocked = ? or blocked = ? or blocked = ?", (domain, "*."+domain, wildchar, get_hash(domain))) else: c.execute("select * from blocks where reason like ? and reason != ''", ("%"+reason+"%",)) blocks = c.fetchall()