Skip to content

Commit

Permalink
incorporate readability feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
wleightond committed Jun 4, 2024
1 parent 1c19851 commit 4019857
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions canarytokens/channel_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,9 @@ def query(self, query: Query, src_ip: str): # noqa C901
):
return defer.succeed(self._do_dynamic_response(name=query.name.name))

if (canarydrop.type == TokenTypes.CMD) and (
invocation_id := src_data["src_data"].get("cmd_invocation_id")
):
if any(
if canarydrop.type == TokenTypes.CMD:
invocation_id = src_data["src_data"].get("cmd_invocation_id")
if (invocation_id is not None) and any(
hit.src_data.get("cmd_invocation_id") == invocation_id
for hit in canarydrop.triggered_details.hits
):
Expand Down

0 comments on commit 4019857

Please sign in to comment.