Return wildcard blocks for second-level domains as well
This commit is contained in:
parent
4d9b9f39ab
commit
b3fa2f5b4a
2
api.py
2
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user