From: Mint <> Date: Sun, 26 Feb 2023 22:06:11 +0000 (+0300) Subject: Handle wildcards in mutual block endpoint X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=03aa6e356025cc96411fce7de680bdb105f6ced0;p=fba.git Handle wildcards in mutual block endpoint --- diff --git a/api.py b/api.py index 43086fd..43967e4 100644 --- a/api.py +++ b/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], }, )