aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-05-05 22:13:23 +0800
committerGitHub <noreply@github.com>2022-05-05 16:13:23 +0200
commit04fc4b7e05bfbfee6cb7aa4f6c30d1af6f2d4d2d (patch)
treef587d103068be565bd3d61e19f113f255f713763 /routers
parent7b089c465d9f851454be91ca209ab26782648a45 (diff)
downloadgitea-04fc4b7e05bfbfee6cb7aa4f6c30d1af6f2d4d2d.tar.gz
gitea-04fc4b7e05bfbfee6cb7aa4f6c30d1af6f2d4d2d.zip
Call MultipartForm.RemoveAll when request finishes (#19606)
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/misc/markdown_test.go2
-rw-r--r--routers/install/install.go2
2 files changed, 4 insertions, 0 deletions
diff --git a/routers/api/v1/misc/markdown_test.go b/routers/api/v1/misc/markdown_test.go
index 349498e2ab..9beb88be16 100644
--- a/routers/api/v1/misc/markdown_test.go
+++ b/routers/api/v1/misc/markdown_test.go
@@ -37,6 +37,8 @@ func createContext(req *http.Request) (*context.Context, *httptest.ResponseRecor
Render: rnd,
Data: make(map[string]interface{}),
}
+ defer c.Close()
+
return c, resp
}
diff --git a/routers/install/install.go b/routers/install/install.go
index 459f534b89..41b11aef33 100644
--- a/routers/install/install.go
+++ b/routers/install/install.go
@@ -79,6 +79,8 @@ func Init(next http.Handler) http.Handler {
"PasswordHashAlgorithms": user_model.AvailableHashAlgorithms,
},
}
+ defer ctx.Close()
+
ctx.Req = context.WithContext(req, &ctx)
next.ServeHTTP(resp, ctx.Req)
})