fix(favicon): add GetFavIconFromAlias function and update favicon handling in idlewatcher

This commit is contained in:
yusing 2025-06-08 15:13:38 +08:00
parent cfe0f6bb70
commit 2263d6063e
2 changed files with 7 additions and 2 deletions

View file

@ -44,6 +44,12 @@ func GetFavIcon(w http.ResponseWriter, req *http.Request) {
return
}
// try with alias
GetFavIconFromAlias(w, req, alias)
return
}
func GetFavIconFromAlias(w http.ResponseWriter, req *http.Request, alias string) {
// try with route.Icon
r, ok := routes.HTTP.Get(alias)
if !ok {

View file

@ -62,8 +62,7 @@ func (w *Watcher) wakeFromHTTP(rw http.ResponseWriter, r *http.Request) (shouldN
// handle favicon request
if isFaviconPath(r.URL.Path) {
r.URL.RawQuery = "alias=" + w.rp.TargetName
favicon.GetFavIcon(rw, r)
favicon.GetFavIconFromAlias(rw, r, w.route.Name())
return false
}