fix: close resp body (#124)

This commit is contained in:
guangwu 2024-05-22 14:13:30 +08:00 committed by GitHub
parent bd26a39049
commit 496a742d20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)