Skip to content

Commit

Permalink
fix: validate imported_version type in AppDslService (#12135)
Browse files Browse the repository at this point in the history
Signed-off-by: -LAN- <[email protected]>
  • Loading branch information
laipz8200 authored Dec 26, 2024
1 parent 4bd8df1 commit e765d8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/services/app_dsl_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ def import_app(
data["kind"] = "app"

imported_version = data.get("version", "0.1.0")
# check if imported_version is a float-like string
if not isinstance(imported_version, str):
raise ValueError(f"Invalid version type, expected str, got {type(imported_version)}")
status = _check_version_compatibility(imported_version)

# Extract app data
Expand Down

0 comments on commit e765d8e

Please sign in to comment.