diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 302f5b33f..fdf7dbcb9 100644 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -48,7 +48,7 @@ func UploadAttachment(ctx *context.Context) { allowed := false for _, t := range allowedTypes { t := strings.Trim(t, " ") - if t == "*/*" || t == fileType { + if t == "*/*" || strings.HasPrefix(fileType, t) { allowed = true break }