SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
adding favicon to filer also
Chris Ludd5661b29767
diff --git a/weed/server/common.go b/weed/server/common.goindex 20177df0ec..85d052993b 100644--- a/weed/server/common.go+++ b/weed/server/common.go@@ -12,6 +12,7 @@ import ("time""github.com/chrislusf/seaweedfs/weed/glog"+ "github.com/chrislusf/seaweedfs/weed/images""github.com/chrislusf/seaweedfs/weed/operation""github.com/chrislusf/seaweedfs/weed/security""github.com/chrislusf/seaweedfs/weed/stats"@@ -188,3 +189,15 @@ func statsMemoryHandler(w http.ResponseWriter, r *http.Request) {m["Memory"] = stats.MemStat()writeJsonQuiet(w, r, http.StatusOK, m)}++func faviconHandler(w http.ResponseWriter, r *http.Request) {+ data, err := images.Asset("favicon/favicon.ico")+ if err != nil {+ glog.V(2).Infoln("favicon read error:", err)+ return+ }++ if e := writeResponseContent("favicon.ico", "image/x-icon", bytes.NewReader(data), w, r); e != nil {+ glog.V(2).Infoln("response write error:", e)+ }+}diff --git a/weed/server/filer_server.go b/weed/server/filer_server.goindex a1dc916501..3e175e9606 100644--- a/weed/server/filer_server.go+++ b/weed/server/filer_server.go@@ -53,6 +53,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, ip string, port int,fs.filer.LoadConfiguration()defaultMux.HandleFunc("/admin/register", fs.registerHandler)+ defaultMux.HandleFunc("/favicon.ico", faviconHandler)defaultMux.HandleFunc("/", fs.filerHandler)if defaultMux != readonlyMux {readonlyMux.HandleFunc("/", fs.readonlyFilerHandler)diff --git a/weed/server/volume_server.go b/weed/server/volume_server.goindex b0620de0b5..0b7e09c59d 100644--- a/weed/server/volume_server.go+++ b/weed/server/volume_server.go@@ -67,7 +67,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,adminMux.HandleFunc("/", vs.privateStoreHandler)if publicMux != adminMux {// separated admin and public port- publicMux.HandleFunc("/favicon.ico", vs.faviconHandler)+ publicMux.HandleFunc("/favicon.ico", faviconHandler)publicMux.HandleFunc("/", vs.publicReadOnlyHandler)}diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.goindex 2d6fe7849e..6ef79dcdbe 100644--- a/weed/server/volume_server_handlers.go+++ b/weed/server/volume_server_handlers.go@@ -51,7 +51,3 @@ func (vs *VolumeServer) publicReadOnlyHandler(w http.ResponseWriter, r *http.Reqvs.GetOrHeadHandler(w, r)}}--func (vs *VolumeServer) faviconHandler(w http.ResponseWriter, r *http.Request) {- vs.FaviconHandler(w, r)-}diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.goindex 9b0fee4ebc..a90d4c0e2c 100644--- a/weed/server/volume_server_handlers_read.go+++ b/weed/server/volume_server_handlers_read.go@@ -151,18 +151,6 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)}}-func (vs *VolumeServer) FaviconHandler(w http.ResponseWriter, r *http.Request) {- data, err := images.Asset("favicon/favicon.ico")- if err != nil {- glog.V(2).Infoln("favicon read error:", err)- return- }-- if e := writeResponseContent("favicon.ico", "image/x-icon", bytes.NewReader(data), w, r); e != nil {- glog.V(2).Infoln("response write error:", e)- }-}-func (vs *VolumeServer) tryHandleChunkedFile(n *storage.Needle, fileName string, w http.ResponseWriter, r *http.Request) (processed bool) {if !n.IsChunkedManifest() || r.URL.Query().Get("cm") == "false" {return false