Explorar o código

fix: close resp body (#124)

guangwu hai 1 ano
pai
achega
496a742d20
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      server/hooks/wechat_push/wechat_push.go

+ 1 - 0
server/hooks/wechat_push/wechat_push.go

@@ -72,6 +72,7 @@ func (w *WeChatPushHook) getWxAccessToken() string {
 	if err != nil {
 		return ""
 	}
+	defer resp.Body.Close()
 	body, _ := io.ReadAll(resp.Body)
 	var ret accessTokenRes
 	_ = json.Unmarshal(body, &ret)