mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 21:07:06 +02:00
fix attachment file size limit in server backend (#35519)
fix #35512 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
1 parent
3917d27467
commit
a4e23b81d3
18 files changed
+169
-109
No files matched your search
@@ -229,8 +229,7 @@ func APIContexter() func(http.Handler) http.Handler {
|
||||
|
||||
// If request sends files, parse them here otherwise the Query() can't be parsed and the CsrfToken will be invalid.
|
||||
if ctx.Req.Method == http.MethodPost && strings.Contains(ctx.Req.Header.Get("Content-Type"), "multipart/form-data") {
|
||||
if err := ctx.Req.ParseMultipartForm(setting.Attachment.MaxSize << 20); err != nil && !strings.Contains(err.Error(), "EOF") { // 32MB max size
|
||||
ctx.APIErrorInternal(err)
|
||||
if !ctx.ParseMultipartForm() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user