Using otelgin.Middleware will cause temporary MultipartForm files not to be destroyed. #5946
Labels
area: instrumentation
Related to an instrumentation package
bug
Something isn't working
instrumentation: otelgin
Description
Using otelgin.Middleware will cause temporary MultipartForm files not to be destroyed.
Environment
otelgin
version: 0.53.0Steps To Reproduce
Expected behavior
Upload a file larger than MaxMultipartMemory, and the HTTP server will generate multipart-xxxx temporary files in the system temporary directory. These files will be automatically destroyed when the request ends. However, if the otelgin.Middleware is used, the temporary files will not be destroyed.
the HTTP server holds the original request, and using otelgin.Middleware replaces the request with c.request = c.request.WithContext(ctx), causing subsequent c.FormFile reads to fall on the new request. As a result, the original request held by the HTTP server does not have the MultipartForm, preventing it from being destroyed.
The text was updated successfully, but these errors were encountered: