summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-30 05:07:50 -0700
committerUnknwon <u@gogs.io>2016-08-30 05:23:59 -0700
commit643142acab44d46aa6c001c90ad5d307a8662b99 (patch)
tree8e26f8959af5175e865d71a35df5dc087ff14dc8 /routers/repo/issue.go
parent7c31f235da287b0ba1499986758332c2c346deb0 (diff)
downloadgitea-643142acab44d46aa6c001c90ad5d307a8662b99.tar.gz
gitea-643142acab44d46aa6c001c90ad5d307a8662b99.zip
Web editor: support upload files
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index a5908c182f..e2d8000e52 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -447,7 +447,6 @@ func UploadIssueAttachment(ctx *context.Context) {
return
}
- allowedTypes := strings.Split(setting.AttachmentAllowedTypes, ",")
file, header, err := ctx.Req.FormFile("file")
if err != nil {
ctx.Error(500, fmt.Sprintf("FormFile: %v", err))
@@ -462,6 +461,7 @@ func UploadIssueAttachment(ctx *context.Context) {
}
fileType := http.DetectContentType(buf)
+ allowedTypes := strings.Split(setting.AttachmentAllowedTypes, ",")
allowed := false
for _, t := range allowedTypes {
t := strings.Trim(t, " ")