MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / CloseResponseBodyGracefully

Function CloseResponseBodyGracefully

common/http.go:12–20  ·  view source on GitHub ↗
(httpResponse *http.Response)

Source from the content-addressed store, hash-verified

10)
11
12func CloseResponseBodyGracefully(httpResponse *http.Response) {
13 if httpResponse == nil || httpResponse.Body == nil {
14 return
15 }
16 err := httpResponse.Body.Close()
17 if err != nil {
18 SysError("failed to close response body: " + err.Error())
19 }
20}
21
22func IOCopyBytesGracefully(c *gin.Context, src *http.Response, data []byte) {
23 if c.Writer == nil {

Callers 5

DoMidjourneyHttpRequestFunction · 0.92
RelayErrorHandlerFunction · 0.92
aliEmbeddingHandlerFunction · 0.92
aliStreamHandlerFunction · 0.92
aliHandlerFunction · 0.92

Calls 2

SysErrorFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected