From 03aa6e356025cc96411fce7de680bdb105f6ced0 Mon Sep 17 00:00:00 2001 From: Mint <> Date: Mon, 27 Feb 2023 01:06:11 +0300 Subject: [PATCH] Handle wildcards in mutual block endpoint --- api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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], }, ) -- 2.39.5