浏览代码

fix: better way to handle github dsl url close #11113 (#11125)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
tags/0.13.0
yihong 11 个月前
父节点
当前提交
2927493cf3
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      api/services/app_dsl_service.py

+ 4
- 0
api/services/app_dsl_service.py 查看文件

) )
try: try:
max_size = 10 * 1024 * 1024 # 10MB 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 = ssrf_proxy.get(yaml_url.strip(), follow_redirects=True, timeout=(10, 10))
response.raise_for_status() response.raise_for_status()
content = response.content content = response.content

正在加载...
取消
保存