diff --git a/monkey/monkey_island/cc/resources/agent_logs.py b/monkey/monkey_island/cc/resources/agent_logs.py index 40152c0fb..74106ea93 100644 --- a/monkey/monkey_island/cc/resources/agent_logs.py +++ b/monkey/monkey_island/cc/resources/agent_logs.py @@ -23,7 +23,7 @@ class AgentLogs(AbstractResource): log_contents = self._agent_log_repository.get_agent_log(agent_id) except UnknownRecordError as err: logger.error(f"Error occurred while getting agent log: {err}") - return {}, HTTPStatus.NOT_FOUND + return "", HTTPStatus.NOT_FOUND return log_contents, HTTPStatus.OK diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_logs.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_logs.py index 0f7e86b53..a6a29a7e9 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_logs.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_logs.py @@ -26,7 +26,7 @@ def flask_client(build_flask_client): def test_agent_logs_endpoint__get_empty(flask_client): resp = flask_client.get(AGENT_LOGS_URL_1, follow_redirects=True) assert resp.status_code == HTTPStatus.NOT_FOUND - assert resp.json == {} + assert resp.json == "" @pytest.mark.parametrize(