I found if upload large file, a file in /tmp will keep forevery until next booting. But go net/server package will call RemoveAll when request finished(https://github.com/golang/go/blob/b5d555991ab73e06e09741952a66dd7eeaf2a185/src/net/http/server.go#L1700)

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

My request and response seem work, but /tmp/multipart-xxxx file not delete by net/server. If i mannual call RemoveAll, it work ok.

Comment From: fengqi

You need to check your middleware to see if they are overriding the  ctx.Request

Comment From: zihuyishi

You need to check your middleware to see if they are overriding the  ctx.Request

I add middleware to add opentelemery. It override c.Request = c.Request.WithContext(ctx). So I must call w.req.MultipartForm.RemoveAll() after c.Next()?