From 40f0c26d715810d1ab771c182ab47cec7d79f996 Mon Sep 17 00:00:00 2001 From: dkoz Date: Tue, 14 Nov 2023 09:33:45 -0500 Subject: [PATCH] Update asa.py Fixed filtering issue with EOS API. --- discordgsm/protocols/asa.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/discordgsm/protocols/asa.py b/discordgsm/protocols/asa.py index 1f1bcd1..5680b0a 100644 --- a/discordgsm/protocols/asa.py +++ b/discordgsm/protocols/asa.py @@ -78,12 +78,13 @@ async def query_server_info(self, access_token, host, port): "Content-Type": "application/json", "Accept": "application/json" } - body = { - "criteria": [ - {"key": "attributes.ADDRESS_s", "op": "EQUAL", "value": host}, - {"key": "attributes.ADDRESSBOUND_s", "op": "EQUAL", "value": f"{host}:{port}"} - ] - } + + criteria = [ + {"key": "attributes.ADDRESS_s", "op": "EQUAL", "value": host}, + {"key": "attributes.ADDRESSBOUND_s", "op": "CONTAINS", "value": f":{port}"} + ] + + body = {"criteria": criteria} async with aiohttp.ClientSession() as session: async with session.post(url, headers=headers, json=body) as response: