Spaces:
Running
Running
Upload router_proxy.py
Browse files- router_proxy.py +2 -1
router_proxy.py
CHANGED
|
@@ -37,7 +37,8 @@ async def proxy_github_zip(req_data: ProxyGithubZipRequest, db: Session = Depend
|
|
| 37 |
|
| 38 |
repo_parts = repo_url.split("/")
|
| 39 |
if len(repo_parts) < 2: return JSONResponse(content={"error": "无效的仓库地址格式"}, status_code=400)
|
| 40 |
-
owner
|
|
|
|
| 41 |
|
| 42 |
# GitHub 官方提供的打包下载 API
|
| 43 |
github_zip_api = f"https://api.github.com/repos/{owner}/{repo}/zipball"
|
|
|
|
| 37 |
|
| 38 |
repo_parts = repo_url.split("/")
|
| 39 |
if len(repo_parts) < 2: return JSONResponse(content={"error": "无效的仓库地址格式"}, status_code=400)
|
| 40 |
+
owner = repo_parts[-2]
|
| 41 |
+
repo = repo_parts[-1].replace(".git", "")
|
| 42 |
|
| 43 |
# GitHub 官方提供的打包下载 API
|
| 44 |
github_zip_api = f"https://api.github.com/repos/{owner}/{repo}/zipball"
|