diff options
Diffstat (limited to 'storage.go')
-rw-r--r-- | storage.go | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/storage.go b/storage.go deleted file mode 100644 index dd6feb2..0000000 --- a/storage.go +++ /dev/null @@ -1,28 +0,0 @@ -package main - -import ( - "io/ioutil" - "log" - "net/http" - "path/filepath" -) - -func ServeStorage(w http.ResponseWriter, r *http.Request, path string) { - - path = filepath.Join(config.Http.Storage, path) - path, err := filepath.Abs(path) - if err != nil { - log.Print(err) - http.Error(w, http.StatusText(400), 400) - return - } - - // TODO check if path is still in storage folder - - http.ServeFile(w, r, path) -} - -func SaveStorageFile(data *[]byte, path string) error { - fullpath := filepath.Join(config.Http.Storage, path) - return ioutil.WriteFile(fullpath, *data, 0644) -} |