From ae4644f287fcfd84e912c2834874c570891cab9e Mon Sep 17 00:00:00 2001 From: tbphp Date: Wed, 9 Jul 2025 17:24:13 +0800 Subject: [PATCH] fix: server close --- internal/proxy/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/proxy/server.go b/internal/proxy/server.go index 3eaa45c..d7a8fd8 100644 --- a/internal/proxy/server.go +++ b/internal/proxy/server.go @@ -120,7 +120,7 @@ func (ps *ProxyServer) logRequest(c *gin.Context, group *models.Group, key *mode // Close cleans up resources func (ps *ProxyServer) Close() { - // Nothing to close for now + close(ps.requestLogChan) } func (ps *ProxyServer) applyParamOverrides(c *gin.Context, group *models.Group) error { @@ -129,7 +129,7 @@ func (ps *ProxyServer) applyParamOverrides(c *gin.Context, group *models.Group) if err != nil { return fmt.Errorf("failed to read request body: %w", err) } - c.Request.Body.Close() // Close the original body + c.Request.Body.Close() // If body is empty, nothing to override, just restore the body if len(bodyBytes) == 0 {