X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=refresh.go;h=607ef4c50281bea7d5e9fd8bd114a92a1dd056fa;hb=cdad100fae7f4daa352b73ed1269bbfd503f7582;hp=fcee245b93d15fce58322dcf1c16c72d8770cd1c;hpb=371b9da450b741c6dc50cf5427fcbdec4335d0fc;p=gocheese.git diff --git a/refresh.go b/refresh.go index fcee245..607ef4c 100644 --- a/refresh.go +++ b/refresh.go @@ -1,6 +1,6 @@ /* GoCheese -- Python private package repository and caching proxy -Copyright (C) 2019-2021 Sergey Matveev +Copyright (C) 2019-2022 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -116,6 +116,12 @@ func refreshDir( 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 @@ -517,9 +523,6 @@ func refreshDir( } if filename == filenameGet || gpgUpdate { - if _, err = os.Stat(path); err != nil { - goto GPGSigSkip - } resp, err := c.Do(agentedReq(uri + GPGSigExt)) if err != nil { goto GPGSigSkip