Skip to content

Commit

Permalink
fix: improve content decoding in AppDslService (#12304)
Browse files Browse the repository at this point in the history
Signed-off-by: -LAN- <laipz8200@outlook.com>
  • Loading branch information
laipz8200 authored Jan 2, 2025
1 parent 0e63176 commit 375aa38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/services/app_dsl_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 375aa38

Please sign in to comment.