Skip to content

Commit

Permalink
fix: Tmp files used by form are not destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallTianTian committed Sep 16, 2021
1 parent 12bc252 commit af08db6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions http2/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2714,6 +2714,11 @@ func (w *responseWriter) handlerDone() {
dirty := rws.dirty
rws.handlerDone = true
w.Flush()

if rws.req != nil && rws.req.MultipartForm != nil {
rws.req.MultipartForm.RemoveAll()
}

w.rws = nil
if !dirty {
// Only recycle the pool if all prior Write calls to
Expand Down

0 comments on commit af08db6

Please sign in to comment.