FS as an interface, close #205

This commit is contained in:
Henrique Dias committed 2017-08-20 09:21:36 +01:00
1 parent 76de8e5940
commit 20818dca93
8 files changed
+64 -36

No files matched your search

+2 -2
View File
@@ -28,7 +28,7 @@ func shareHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, e
}
func shareGetHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, error) {
path := filepath.Join(string(c.User.FileSystem), r.URL.Path)
path := filepath.Join(c.User.Scope, r.URL.Path)
s, err := c.Store.Share.GetByPath(path)
if err == storm.ErrNotFound {
return http.StatusNotFound, nil
@@ -49,7 +49,7 @@ func shareGetHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int
}
func sharePostHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, error) {
path := filepath.Join(string(c.User.FileSystem), r.URL.Path)
path := filepath.Join(c.User.Scope, r.URL.Path)
var s *fm.ShareLink
expire := r.URL.Query().Get("expires")