mirror of
https://git.kiwifarms.net/mint/fedi-block-api.git
synced 2024-10-23 01:19:04 +00:00
use wildchar for domain
This commit is contained in:
parent
bc803a16a7
commit
5bbe09862d
1 changed files with 2 additions and 1 deletions
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…
Reference in a new issue