mirror of
https://git.kiwifarms.net/mint/fedi-block-api.git
synced 2024-10-23 00:19:06 +00:00
Handle wildcards in mutual block endpoint
This commit is contained in:
parent
e4caf63d48
commit
03aa6e3560
1 changed files with 2 additions and 1 deletions
3
api.py
3
api.py
|
@ -136,11 +136,12 @@ def mutual(domains: list[str] = Query()):
|
|||
c = conn.cursor()
|
||||
c.execute(
|
||||
"SELECT block_level FROM blocks " \
|
||||
"WHERE ((blocker = :a OR blocker = :b) AND (blocked = :b OR blocked = :a)) " \
|
||||
"WHERE ((blocker = :a OR blocker = :b) AND (blocked = :b OR blocked = :a OR blocked = :w)) " \
|
||||
"AND block_level = 'reject' " \
|
||||
"LIMIT 1",
|
||||
{
|
||||
"a": domains[0],
|
||||
"w": "*." + domains[0],
|
||||
"b": domains[1],
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue