]> Cypherpunks.ru repositories - gocheese.git/blobdiff - refresh.go
Additional signature with my new main key
[gocheese.git] / refresh.go
index fcee245b93d15fce58322dcf1c16c72d8770cd1c..607ef4c50281bea7d5e9fd8bd114a92a1dd056fa 100644 (file)
@@ -1,6 +1,6 @@
 /*
 GoCheese -- Python private package repository and caching proxy
-Copyright (C) 2019-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2019-2022 Sergey Matveev <stargrave@stargrave.org>
 
 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