From b3fa2f5b4a866dd7fada728766686b005aff14e6 Mon Sep 17 00:00:00 2001 From: Mint <> Date: Sun, 7 Aug 2022 10:21:22 +0300 Subject: [PATCH] Return wildcard blocks for second-level domains as well --- api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- 2.39.5