feat(fonts): add fonts storage
All checks were successful
build / Go-Build (pull_request) Successful in 1m24s
build / Go-Build (push) Successful in 38s

This commit is contained in:
2026-02-12 14:16:37 +01:00
parent fffd276238
commit 7a9cf7ab93
5 changed files with 94 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ func HandleCommandline() {
} else if help {
flag.PrintDefaults()
} else {
svg.Storage = svg.NewFileStorage(datapath)
svg.Storage = svg.NewFileStorage(datapath, "fonts")
server.PrepareHTTP()
server.Start()
}

12
internal/routes/font.go Normal file
View File

@@ -0,0 +1,12 @@
package routes
import "net/http"
func AddFont(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Content-Type") != "font/ttf" {
http.Error(w, "", http.StatusUnsupportedMediaType)
return
}
}