0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 20:04:32 +01:00

Use custom favicon when viewing static files if it exists (#19130)

Redirect `/favicon.ico` to `/assets/img/favicon.png`.

Fix #19109
This commit is contained in:
Abheek Dhawan 2022-03-19 14:53:31 -05:00 committed by GitHub
parent 3322f4d7cc
commit f96e8be41f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,6 +99,11 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
http.Redirect(w, req, path.Join(setting.StaticURLPrefix, "/assets/img/apple-touch-icon.png"), 301)
})
// redirect default favicon to the path of the custom favicon with a default as a fallback
routes.Get("/favicon.ico", func(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req, path.Join(setting.StaticURLPrefix, "/assets/img/favicon.png"), 301)
})
common := []interface{}{}
if setting.EnableGzip {