From 375aa38f5d18a65e05e3b6be8a325739f3df5cad Mon Sep 17 00:00:00 2001 From: -LAN- Date: Thu, 2 Jan 2025 16:54:46 +0800 Subject: [PATCH] fix: improve content decoding in AppDslService (#12304) Signed-off-by: -LAN- --- api/services/app_dsl_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/services/app_dsl_service.py b/api/services/app_dsl_service.py index 2c4fbe1a596cac..f81ce8393e3a8a 100644 --- a/api/services/app_dsl_service.py +++ b/api/services/app_dsl_service.py @@ -104,7 +104,7 @@ def import_app( raise ValueError(f"Invalid import_mode: {import_mode}") # Get YAML content - content: bytes | str = b"" + content: str = "" if mode == ImportMode.YAML_URL: if not yaml_url: return Import( @@ -124,7 +124,7 @@ def import_app( yaml_url = yaml_url.replace("/blob/", "/") response = ssrf_proxy.get(yaml_url.strip(), follow_redirects=True, timeout=(10, 10)) response.raise_for_status() - content = response.content + content = response.content.decode() if len(content) > max_size: return Import(