diff --git a/src/main.go b/src/main.go index cd542cb..c97e13b 100644 --- a/src/main.go +++ b/src/main.go @@ -67,15 +67,15 @@ func registerFrontendRoutes(router *gin.Engine, enabled bool) { router.GET("/images", notFound) router.GET("/search", notFound) router.GET("/assets/*filepath", notFound) - router.GET("/favicon.svg", notFound) + router.GET("/favicon.ico", notFound) return } router.GET("/", serveSPA) router.GET("/images", serveSPA) router.GET("/search", serveSPA) - router.GET("/favicon.svg", func(c *gin.Context) { - serveEmbedFile(c, "dist/favicon.svg") + router.GET("/favicon.ico", func(c *gin.Context) { + serveEmbedFile(c, "dist/favicon.ico") }) router.GET("/assets/*filepath", func(c *gin.Context) { filepath := strings.TrimPrefix(c.Param("filepath"), "/") diff --git a/src/main_test.go b/src/main_test.go index be5952f..913cdbd 100644 --- a/src/main_test.go +++ b/src/main_test.go @@ -71,7 +71,7 @@ func TestFrontendDisabledRoutesReturnNotFound(t *testing.T) { enableFrontend = false `) - for _, path := range []string{"/", "/images", "/search", "/favicon.svg"} { + for _, path := range []string{"/", "/images", "/search", "/favicon.ico"} { w := performRequest(router, http.MethodGet, path, "") if w.Code != http.StatusNotFound { t.Fatalf("%s status = %d, want 404", path, w.Code) diff --git a/src/utils/ratelimiter.go b/src/utils/ratelimiter.go index 4741e40..6531319 100644 --- a/src/utils/ratelimiter.go +++ b/src/utils/ratelimiter.go @@ -213,7 +213,7 @@ func RateLimitMiddleware(limiter *IPRateLimiter) gin.HandlerFunc { return func(c *gin.Context) { path := c.Request.URL.Path if path == "/" || path == "/images" || path == "/search" || - path == "/favicon.svg" || + path == "/favicon.ico" || strings.HasPrefix(path, "/assets/") { c.Next() return diff --git a/web/index.html b/web/index.html index e1ede59..58b4cd3 100644 --- a/web/index.html +++ b/web/index.html @@ -2,7 +2,7 @@
- +