mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
http2: delete multipart form tempfiles after ServeHTTP returns
Do the same post-handler cleanup as the HTTP/1 server does. No test here; test for HTTP/1 and HTTP/2 in CL 423194. For golang/go#20253. Change-Id: Iba54110ad2844571076c721d7ec19c39ba36de79 Reviewed-on: https://go-review.googlesource.com/c/net/+/423055 Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
@@ -2229,6 +2229,9 @@ func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler
|
||||
didPanic := true
|
||||
defer func() {
|
||||
rw.rws.stream.cancelCtx()
|
||||
if req.MultipartForm != nil {
|
||||
req.MultipartForm.RemoveAll()
|
||||
}
|
||||
if didPanic {
|
||||
e := recover()
|
||||
sc.writeFrameFromHandler(FrameWriteRequest{
|
||||
|
||||
Reference in New Issue
Block a user