aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weed/server/common.go6
-rw-r--r--weed/server/master_server.go1
2 files changed, 7 insertions, 0 deletions
diff --git a/weed/server/common.go b/weed/server/common.go
index 215ee1036..9b9ed7659 100644
--- a/weed/server/common.go
+++ b/weed/server/common.go
@@ -20,6 +20,7 @@ import (
_ "github.com/chrislusf/seaweedfs/weed/statik"
statik "github.com/rakyll/statik/fs"
+ "github.com/gorilla/mux"
)
var serverStats *stats.ServerStats
@@ -198,3 +199,8 @@ func handleStaticResources(defaultMux *http.ServeMux) {
defaultMux.Handle("/favicon.ico", http.FileServer(statikFS))
defaultMux.Handle("/seaweedfsstatic/", http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
}
+
+func handleStaticResources2(r *mux.Router) {
+ r.Handle("/favicon.ico", http.FileServer(statikFS))
+ r.PathPrefix("/seaweedfsstatic/").Handler(http.StripPrefix("/seaweedfsstatic", http.FileServer(statikFS)))
+}
diff --git a/weed/server/master_server.go b/weed/server/master_server.go
index 07a398ead..a0d7e9605 100644
--- a/weed/server/master_server.go
+++ b/weed/server/master_server.go
@@ -69,6 +69,7 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string,
ms.guard = security.NewGuard(whiteList, secureKey)
+ handleStaticResources2(r)
r.HandleFunc("/", ms.uiStatusHandler)
r.HandleFunc("/ui/index.html", ms.uiStatusHandler)
r.HandleFunc("/dir/assign", ms.proxyToLeader(ms.guard.WhiteList(ms.dirAssignHandler)))