Browse Source

fix: close resp body (#124)

guangwu 1 năm trước cách đây
mục cha
commit
496a742d20
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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)