More updates :)

This commit is contained in:
Henrique Dias committed 2017-08-20 08:49:09 +01:00
1 parent 5b619337df
commit 76de8e5940
4 files changed
+20 -7

No files matched your search

+3 -2
View File
@@ -13,8 +13,8 @@ import (
fm "github.com/hacdias/filemanager"
)
// ServeHTTP returns a function compatible with http.HandleFunc.
func ServeHTTP(m *fm.FileManager) http.Handler {
// Handler returns a function compatible with http.HandleFunc.
func Handler(m *fm.FileManager) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
code, err := serve(&fm.Context{
FileManager: m,
@@ -235,6 +235,7 @@ func renderFile(c *fm.Context, w http.ResponseWriter, file string, contentType s
return 0, nil
}
// sharePage build the share page.
func sharePage(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, error) {
s, err := c.Store.Share.Get(r.URL.Path)
if err == storm.ErrNotFound {