mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-16 22:57:53 +08:00
Defer wrapper.Finalize(c) in RequestLoggingMiddleware, stamp a 500 status when a handler panics before writing a response, and mark the wrapper finalized so outer recovery middleware does not reopen a second streaming log writer. Also pass the chunk channel and stream writer by value to processStreamingChunks to avoid racing with Finalize clearing wrapper fields. Fixes #7161