]> git.mxchange.org Git - fba.git/commitdiff
Return wildcard blocks for second-level domains as well
authorMint <>
Sun, 7 Aug 2022 07:21:22 +0000 (10:21 +0300)
committerMint <>
Sun, 7 Aug 2022 07:21:22 +0000 (10:21 +0300)
api.py

diff --git a/api.py b/api.py
index 440e48a421c97a6171f9278c30e47cec4e7d2170..f099755bd68a91d7914d46136dd9207379e3c191 100644 (file)
--- 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()