File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -369,8 +369,8 @@ func InitContext() martini.Handler {
369
369
}
370
370
371
371
// If request sends files, parse them here otherwise the Query() can't be parsed and the CsrfToken will be invalid.
372
- if strings .Contains (r .Header .Get ("Content-Type" ), "multipart/form-data" ) {
373
- if err = ctx .Req .ParseMultipartForm (setting .AttachmentMaxSize << 20 ); err != nil { // 32MB max size
372
+ if r . Method == "POST" && strings .Contains (r .Header .Get ("Content-Type" ), "multipart/form-data" ) {
373
+ if err = ctx .Req .ParseMultipartForm (setting .AttachmentMaxSize << 20 ); err != nil && ! strings . Contains ( err . Error (), "EOF" ) { // 32MB max size
374
374
ctx .Handle (500 , "issue.Comment(ctx.Req.ParseMultipartForm)" , err )
375
375
return
376
376
}
You can’t perform that action at this time.
0 commit comments