Browse Source

fix bug:404 when downloading other user's public attachment

tags/v1.21.12.1
yuyuanshifu 5 years ago
parent
commit
a44de2bf22
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/repo/attachment.go

+ 1
- 1
routers/repo/attachment.go View File

@@ -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
}


Loading…
Cancel
Save