mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(dashboard): properly serve fonts in backend
This commit is contained in:
parent
07e653a1b8
commit
ec81bb0c80
1 changed files with 6 additions and 0 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue