mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Ignore EOF error when parsing form.
This commit is contained in:
		@@ -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 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 r.Method == "POST" && strings.Contains(r.Header.Get("Content-Type"), "multipart/form-data") {
 | 
				
			||||||
			if err = ctx.Req.ParseMultipartForm(setting.AttachmentMaxSize << 20); err != nil { // 32MB max size
 | 
								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)
 | 
									ctx.Handle(500, "issue.Comment(ctx.Req.ParseMultipartForm)", err)
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user