Skip to content

Commit

Permalink
Update asa.py
Browse files Browse the repository at this point in the history
Fixed filtering issue with EOS API.
  • Loading branch information
dkoz committed Nov 14, 2023
1 parent 9f33a13 commit 40f0c26
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions discordgsm/protocols/asa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 40f0c26

Please sign in to comment.