From 643142acab44d46aa6c001c90ad5d307a8662b99 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 30 Aug 2016 05:07:50 -0700 Subject: Web editor: support upload files --- routers/repo/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/repo/issue.go') diff --git a/routers/repo/issue.go b/routers/repo/issue.go index a5908c18..e2d8000e 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, " ") -- cgit v1.2.3