From d98bbba808f3536142e8c04f4a2f3751b7efb11b Mon Sep 17 00:00:00 2001 From: freeziyou <80776877@qq.com> Date: Tue, 27 Feb 2024 16:21:07 +0800 Subject: [PATCH] hotfix get_image --- server/routes/user.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/routes/user.py b/server/routes/user.py index ece91c1f..899f3191 100644 --- a/server/routes/user.py +++ b/server/routes/user.py @@ -86,12 +86,14 @@ def download_and_respond(): if not referer: # 公开仓库不校验 repo = get_repo_by_repo_id(repo_id) + if not repo: + return abort(404, "Not found repo!") is_private = repo.extra.get("private", False) app.logger.debug(f"is_private: {is_private}") # 私有仓库校验,先登录 if is_private: - return abort(403) + return abort(403, "Not support private repo!") return download_and_respond()