From a44de2bf221da6640654958e9b8a38ac6a4e384b Mon Sep 17 00:00:00 2001 From: yuyuanshifu <747342561@qq.com> Date: Sun, 18 Oct 2020 15:35:23 +0800 Subject: [PATCH] fix bug:404 when downloading other user's public attachment --- routers/repo/attachment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 6c9817360..71446f1d4 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -139,7 +139,7 @@ func GetAttachment(ctx *context.Context) { } if repository == nil { //If not linked - if !(ctx.IsSigned && attach.UploaderID == ctx.User.ID) { //We block if not the uploader + if !(ctx.IsSigned && attach.UploaderID == ctx.User.ID) && attach.IsPrivate { //We block if not the uploader ctx.Error(http.StatusNotFound) return }