diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-05-05 22:13:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 16:13:23 +0200 |
commit | 04fc4b7e05bfbfee6cb7aa4f6c30d1af6f2d4d2d (patch) | |
tree | f587d103068be565bd3d61e19f113f255f713763 /routers | |
parent | 7b089c465d9f851454be91ca209ab26782648a45 (diff) | |
download | gitea-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.go | 2 | ||||
-rw-r--r-- | routers/install/install.go | 2 |
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) }) |