• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 21693232976

05 Feb 2026 12:02AM UTC coverage: 60.712% (-0.008%) from 60.72%
21693232976

push

github

web-flow
Fix audit middleware file handle leak on shutdown (#3074)

* Fix audit middleware file handle leak on shutdown

Store Auditor reference in Middleware struct to enable proper cleanup.
Update Close() to call Auditor.Close() for file-based logging.
Use NewAuditorWithTransport directly instead of CreateMiddlewareWithTransport.

This ensures audit log file handles are properly closed when the runner
shuts down, preventing resource leaks and ensuring logs are flushed.

* Remove unused audit middleware factory functions

Delete CreateMiddlewareWithTransport and GetMiddlewareFromFile functions
along with their tests. These functions had a design flaw where they
created an Auditor but only returned the middleware function, making it
impossible for callers to close file handles.

The CreateMiddleware factory now calls NewAuditorWithTransport directly,
making these wrapper functions unnecessary.

7 of 9 new or added lines in 1 file covered. (77.78%)

9 existing lines in 4 files now uncovered.

40567 of 66819 relevant lines covered (60.71%)

75.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.58
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc