avoid logging errors on misguided favicon.ico requests
1 file changed, 7 insertions(+), 0 deletions(-)
changed files
M routes/handler.go → routes/handler.go
@@ -12,6 +12,7 @@ "time" "github.com/fsnotify/fsnotify" "github.com/savsgio/atreugo/v11" + "github.com/valyala/fasthttp" "alin.ovh/elgit/config" )@@ -101,6 +102,12 @@ d.mountRepoPaths(srv.NewGroupPath("/{category}/{name}")) srv.StaticFS("/static/", staticFiles) srv.GET("/", d.Index) + srv.GET("/favicon.ico", func(rc *atreugo.RequestCtx) error { + return rc.TextResponse( + fasthttp.StatusMessage(fasthttp.StatusNoContent), + fasthttp.StatusNoContent, + ) + }) return srv }