From cb8fda0beccf4bb2140a35f8ba902df0a97022f5 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 19 Sep 2022 19:57:28 -0400 Subject: [PATCH] Agent: Add HTTPIslandAPIClient._api_url attribute --- .../island_api_client/http_island_api_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/island_api_client/http_island_api_client.py b/monkey/infection_monkey/island_api_client/http_island_api_client.py index bf6d085db..9d85447ea 100644 --- a/monkey/infection_monkey/island_api_client/http_island_api_client.py +++ b/monkey/infection_monkey/island_api_client/http_island_api_client.py @@ -39,11 +39,12 @@ class HTTPIslandAPIClient(IIslandAPIClient): ) self._island_server = island_server + self._api_url = f"https://{self._island_server}/api" @handle_island_errors def send_log(self, log_contents: str): requests.post( # noqa: DUO123 - f"https://{self._island_server}/api/log", + f"{self._api_url}/log", json=log_contents, verify=False, timeout=MEDIUM_REQUEST_TIMEOUT, @@ -52,7 +53,7 @@ class HTTPIslandAPIClient(IIslandAPIClient): @handle_island_errors def get_pba_file(self, filename: str): response = requests.get( # noqa: DUO123 - f"https://{self._island_server}/api/pba/download/{filename}", + f"{self._api_url}/pba/download/{filename}", verify=False, timeout=LONG_REQUEST_TIMEOUT, )