mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-18 19:47:28 +00:00
14 lines
281 B
Go
14 lines
281 B
Go
package common
|
|
|
|
import "net/http"
|
|
|
|
func CloseResponseBodyGracefully(httpResponse *http.Response) {
|
|
if httpResponse == nil || httpResponse.Body == nil {
|
|
return
|
|
}
|
|
err := httpResponse.Body.Close()
|
|
if err != nil {
|
|
SysError("failed to close response body: " + err.Error())
|
|
}
|
|
}
|