🔥 close res.body for proxy

pull/548/head
微凉 2022-01-18 11:29:32 +08:00
parent 96a237902b
commit 4a21b6fe1d
1 changed files with 3 additions and 0 deletions

View File

@ -125,6 +125,9 @@ func Proxy(c *gin.Context) {
common.ErrorResp(c, err, 500)
return
}
defer func() {
_ = res.Body.Close()
}()
w.WriteHeader(res.StatusCode)
for h, v := range res.Header {
w.Header()[h] = v