MM-25006: Fix occurences of unclosed http bodies (#14521)
* MM-25006: Fix occurences of unclosed http bodies And while here, we also use ioutil.Discard to read the remaining body instead of reading with ioutil.ReadAll which allocates a separate byte buffer. * Fix mistake * Address review comments Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ee8bd4ece4
Коммит
15ed9a8f20
@@ -106,7 +106,7 @@ func (s *Server) DoSecurityUpdateCheck() {
|
||||
}
|
||||
|
||||
body, err := ioutil.ReadAll(resBody.Body)
|
||||
res.Body.Close()
|
||||
resBody.Body.Close()
|
||||
if err != nil || resBody.StatusCode != 200 {
|
||||
mlog.Error("Failed to read security bulletin details")
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user