Browse Source

Merge pull request 'fix bug:404 when downloading other user's public attachment' (#96) from fix- into develop

Reviewed-by: 郭明月 <guomy@pcl.ac.cn>
tags/v1.21.12.1
yuyuanshifu 5 years ago
parent
commit
0b27d1eea0
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