mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Call MultipartForm.RemoveAll when request finishes (#19606)
This commit is contained in:
		@@ -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)
 | 
			
		||||
	})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user