]> Cypherpunks.ru repositories - gocheese.git/blobdiff - gocheese.go
Do not output binary digest
[gocheese.git] / gocheese.go
index 7a36129746ab96d1254564d69385323639531d1d..5c6e80a2fc172d81d676e77f1199c3d3cb90dcc0 100644 (file)
@@ -107,8 +107,8 @@ func refreshDir(w http.ResponseWriter, r *http.Request, dir, filenameGet string)
                http.Error(w, err.Error(), http.StatusBadGateway)
                return false
        }
-       defer resp.Body.Close()
        body, err := ioutil.ReadAll(resp.Body)
+       resp.Body.Close()
        if err != nil {
                http.Error(w, err.Error(), http.StatusBadGateway)
                return false
@@ -249,7 +249,7 @@ func listDir(w http.ResponseWriter, r *http.Request, dir string, autorefresh boo
                        HTMLElement,
                        strings.Join([]string{
                                *refreshURLPath, dir, "/",
-                               filenameClean, "#", SHA256Prefix, string(data),
+                               filenameClean, "#", SHA256Prefix, hex.EncodeToString(data),
                        }, ""),
                        filenameClean,
                )))