use wildchar for domain
This commit is contained in:
parent
bc803a16a7
commit
5bbe09862d
3
api.py
3
api.py
@ -22,7 +22,8 @@ def info():
|
|||||||
def blocked(domain: str):
|
def blocked(domain: str):
|
||||||
conn = sqlite3.connect("blocks.db")
|
conn = sqlite3.connect("blocks.db")
|
||||||
c = conn.cursor()
|
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()
|
blocks = c.fetchall()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user