From 805b8f5b3e4b49a90f251719b88c440b6976db43 Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Tue, 9 Jan 2024 19:10:54 -0500 Subject: [PATCH] allnet: fix error parsing dli files --- core/allnet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/allnet.py b/core/allnet.py index 219f331..aa82071 100644 --- a/core/allnet.py +++ b/core/allnet.py @@ -345,7 +345,7 @@ class AllnetServlet: return PlainTextResponse(res_str) async def handle_dlorder_ini(self, request: Request) -> bytes: - req_file = request.path_params.get("file", "").replace("%0A", "") + req_file = request.path_params.get("file", "").replace("%0A", "").replace("\n", "") if not req_file: return PlainTextResponse(status_code=404) @@ -355,7 +355,7 @@ class AllnetServlet: await self.data.base.log_event("allnet", "DLORDER_INI_SENT", logging.INFO, f"{Utils.get_ip_addr(request)} successfully recieved {req_file}") return PlainTextResponse(open( - f"{self.config.allnet.update_cfg_folder}/{req_file}", "r" + f"{self.config.allnet.update_cfg_folder}/{req_file}", "r", encoding="utf-8" ).read()) self.logger.info(f"DL INI File {req_file} not found")