X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gocheese.go;h=5c6e80a2fc172d81d676e77f1199c3d3cb90dcc0;hb=443748e27be6e25fb36b1d32d4aee1a3da1b5539;hp=7a36129746ab96d1254564d69385323639531d1d;hpb=902150e27fa1530823817eb3227f9100b27d9410;p=gocheese.git diff --git a/gocheese.go b/gocheese.go index 7a36129..5c6e80a 100644 --- a/gocheese.go +++ b/gocheese.go @@ -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, )))