fix: 修复aws claude渠道panic的问题

This commit is contained in:
crabkun 2024-07-21 01:27:29 +08:00
parent 3875b141c6
commit 96bdf97194

View File

@ -222,9 +222,11 @@ func awsStreamHandler(c *gin.Context, resp *http.Response, info *relaycommon.Rel
}
}
service.Done(c)
if resp != nil {
err = resp.Body.Close()
if err != nil {
return service.OpenAIErrorWrapperLocal(err, "close_response_body_failed", http.StatusInternalServerError), nil
}
}
return nil, &usage
}