diff --git a/assets.go b/assets.go index 95c4f8be5..e5d5ebe8a 100644 --- a/assets.go +++ b/assets.go @@ -77,7 +77,7 @@ func loadTemplate(t *template.Template, path string) *template.Template { return t } -func serverFileOrEmpty(path string, contentType string, c *gin.Context) { +func serveFileOr404(path string, contentType string, c *gin.Context) { if path == "" { c.Data(200, contentType, nil) return diff --git a/main.go b/main.go index 503d53bfe..4d0fca3e9 100644 --- a/main.go +++ b/main.go @@ -88,10 +88,10 @@ func setupRouter(router *gin.Engine) { router.GET(getViewURL("/labelValues.json"), knownLabelValues) router.GET(getViewURL("/custom.css"), func(c *gin.Context) { - serverFileOrEmpty(config.Config.Custom.CSS, "text/css", c) + serveFileOr404(config.Config.Custom.CSS, "text/css", c) }) router.GET(getViewURL("/custom.js"), func(c *gin.Context) { - serverFileOrEmpty(config.Config.Custom.JS, "application/javascript", c) + serveFileOr404(config.Config.Custom.JS, "application/javascript", c) }) router.NoRoute(notFound)