Commit 5084a43a by CaIon

refactor: ensure graceful closure of response body in relay responses

parent c6c40e0a
...@@ -59,6 +59,8 @@ func OaiResponsesStreamHandler(c *gin.Context, info *relaycommon.RelayInfo, resp ...@@ -59,6 +59,8 @@ func OaiResponsesStreamHandler(c *gin.Context, info *relaycommon.RelayInfo, resp
return nil, types.NewError(fmt.Errorf("invalid response"), types.ErrorCodeBadResponse) return nil, types.NewError(fmt.Errorf("invalid response"), types.ErrorCodeBadResponse)
} }
defer service.CloseResponseBodyGracefully(resp)
var usage = &dto.Usage{} var usage = &dto.Usage{}
var responseTextBuilder strings.Builder var responseTextBuilder strings.Builder
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment