Skip to content

Commit

Permalink
fix: better way to handle github dsl url close #11113
Browse files Browse the repository at this point in the history
Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 committed Nov 26, 2024
1 parent ab6dcf7 commit 7ad0f24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/services/app_dsl_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def import_app(
)
try:
max_size = 10 * 1024 * 1024 # 10MB
# tricky way to handle url from github to github raw url
if yaml_url.startswith("https://github.com") and yaml_url.endswith((".yml", ".yaml")):
yaml_url = yaml_url.replace("https://github.com", "https://raw.githubusercontent.com")
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
Expand Down

0 comments on commit 7ad0f24

Please sign in to comment.