summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJustin Nuß <justin.nuss@hmmh.de>2014-07-25 10:18:42 +0200
committerJustin Nuß <justin.nuss@hmmh.de>2014-07-25 10:18:42 +0200
commitf7617997cebd0f347415da47545fbf16e5d0653e (patch)
tree11d5afb85acf1deae41ca2c47c456e3351a8e1cb /modules
parent204ef41b0961379f0ba33fad98bed335582c45ea (diff)
downloadgitea-f7617997cebd0f347415da47545fbf16e5d0653e.tar.gz
gitea-f7617997cebd0f347415da47545fbf16e5d0653e.zip
Ignore EOF error when parsing form.
Diffstat (limited to 'modules')
-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
}