Call MultipartForm.RemoveAll when request finishes (#19606)
This commit is contained in:
parent
7b089c465d
commit
04fc4b7e05
7 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue