refresh.go | 6 ++++++ diff --git a/refresh.go b/refresh.go index 053c619b0d40bf69dc0bb6223d17071ac26709c6f1a6714defc3001ca77d5b34..d7b14f45c90cb4f40ca04c72239db30b9f93ab903f873a9db696950578ec0138 100644 --- a/refresh.go +++ b/refresh.go @@ -116,6 +116,12 @@ http.Error(w, "PyPI has non 200 status code", http.StatusBadGateway) return false } body, err := ioutil.ReadAll(resp.Body) + if err != nil { + resp.Body.Close() + log.Println("error", r.RemoteAddr, "refresh-json", pkgName, err) + http.Error(w, "can not read body", http.StatusBadGateway) + return false + } resp.Body.Close() var buf bytes.Buffer var description string