소스 검색

fix: close resp body (#124)

guangwu 1 년 전
부모
커밋
496a742d20
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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)