From ec81bb0c806b956ef0f302965f139c160c97b4ba Mon Sep 17 00:00:00 2001 From: Jake Fulmine Date: Thu, 11 Apr 2024 14:59:20 +0200 Subject: [PATCH] fix(dashboard): properly serve fonts in backend --- dashboard/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dashboard/main.go b/dashboard/main.go index 267592f5..926b23fc 100644 --- a/dashboard/main.go +++ b/dashboard/main.go @@ -75,6 +75,12 @@ func notFoundHandler(rw http.ResponseWriter, r *http.Request) { rw.Header().Set("content-type", "text/css") } else if strings.HasSuffix(r.URL.Path, ".map") { data, err = fs.ReadFile("dist" + r.URL.Path) + } else if strings.HasSuffix(r.URL.Path, ".ttf") { + data, err = fs.ReadFile("dist" + r.URL.Path) + rw.Header().Set("content-type", "application/x-font-ttf") + } else if strings.HasSuffix(r.URL.Path, ".woff2") { + data, err = fs.ReadFile("dist" + r.URL.Path) + rw.Header().Set("content-type", "application/font-woff2") } else { data, err = fs.ReadFile("dist/index.html") rw.Header().Set("content-type", "text/html")