diff --git a/pkg/routes/api/v1/user_export.go b/pkg/routes/api/v1/user_export.go index 1c2fd4117..b01b1fdf3 100644 --- a/pkg/routes/api/v1/user_export.go +++ b/pkg/routes/api/v1/user_export.go @@ -131,6 +131,7 @@ func DownloadUserDataExport(c *echo.Context) error { } return err } + defer func() { _ = exportFile.File.Close() }() // Downloads must never be cached; no-cache overrides the global no-store // directive while still allowing revalidation.