]> Cypherpunks.ru repositories - gocheese.git/blobdiff - gocheese.go
TempFile is not friendly with umask. Replace with simpler one
[gocheese.git] / gocheese.go
index 2245d5cafc5743f6b1a6a73d9464497437c0c5cb..9b74ee7d5cf729b6f6f0faf09fb108b26ca896bc 100644 (file)
@@ -154,7 +154,7 @@ func refreshDir(w http.ResponseWriter, r *http.Request, dir, filenameGet string)
                        }
                        defer resp.Body.Close()
                        hasher := sha256.New()
-                       dst, err := ioutil.TempFile(filepath.Join(*root, dir), "")
+                       dst, err := TempFile(filepath.Join(*root, dir))
                        if err != nil {
                                http.Error(w, err.Error(), http.StatusInternalServerError)
                                return false
@@ -322,7 +322,7 @@ func serveUpload(w http.ResponseWriter, r *http.Request) {
                        http.Error(w, err.Error(), http.StatusInternalServerError)
                        return
                }
-               dst, err = ioutil.TempFile(dirPath, "")
+               dst, err = TempFile(dirPath)
                if err != nil {
                        http.Error(w, err.Error(), http.StatusInternalServerError)
                        return