summaryrefslogtreecommitdiffstats
path: root/modules/middleware/context.go
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-07-25 13:35:25 -0400
committer无闻 <joe2010xtmf@163.com>2014-07-25 13:35:25 -0400
commitaad91d4b21b2aae438162e10f698e81abb4e63ee (patch)
treec21d71a7c7c4794d9f3109502f529e3d8be47fe0 /modules/middleware/context.go
parent204ef41b0961379f0ba33fad98bed335582c45ea (diff)
parentf0da8a68c2c409572902275888fec26689c2b0dd (diff)
downloadgitea-aad91d4b21b2aae438162e10f698e81abb4e63ee.tar.gz
gitea-aad91d4b21b2aae438162e10f698e81abb4e63ee.zip
Merge pull request #324 from nuss-justin/issue/318
Fix #318. Issues attachments: allow Select Attachments to append files
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r--modules/middleware/context.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index cf849802d9..90cfb1bb04 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -369,8 +369,8 @@ func InitContext() martini.Handler {
}
// If request sends files, parse them here otherwise the Query() can't be parsed and the CsrfToken will be invalid.
- if strings.Contains(r.Header.Get("Content-Type"), "multipart/form-data") {
- if err = ctx.Req.ParseMultipartForm(setting.AttachmentMaxSize << 20); err != nil { // 32MB max size
+ if r.Method == "POST" && strings.Contains(r.Header.Get("Content-Type"), "multipart/form-data") {
+ if err = ctx.Req.ParseMultipartForm(setting.AttachmentMaxSize << 20); err != nil && !strings.Contains(err.Error(), "EOF") { // 32MB max size
ctx.Handle(500, "issue.Comment(ctx.Req.ParseMultipartForm)", err)
return
}