fix: Prevent resource leaks by adding body close in stream handlers

This commit is contained in:
1808837298@qq.com
2025-03-05 19:51:22 +08:00
parent 37a83ecc33
commit 558e625a01
4 changed files with 7 additions and 4 deletions

View File

@@ -506,7 +506,7 @@ func ClaudeStreamHandler(c *gin.Context, resp *http.Response, info *relaycommon.
}
}
helper.Done(c)
resp.Body.Close()
//resp.Body.Close()
return nil, usage
}

View File

@@ -534,7 +534,7 @@ func GeminiChatStreamHandler(c *gin.Context, resp *http.Response, info *relaycom
}
}
helper.Done(c)
resp.Body.Close()
//resp.Body.Close()
return nil, usage
}

View File

@@ -249,7 +249,7 @@ func OaiStreamHandler(c *gin.Context, resp *http.Response, info *relaycommon.Rel
helper.Done(c)
resp.Body.Close()
//resp.Body.Close()
return nil, usage
}