From 9bbb99d83235fe294bb3e12ae5c3f0111b8db867 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Tue, 20 May 2025 21:56:39 +0300 Subject: [PATCH] knotserver: simplify svg exception for now Let's stick to just the file extension alone since we sometimes seem to get text/plain as the MIME type. --- knotserver/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knotserver/routes.go b/knotserver/routes.go index 36b7f8bb..3d26d14c 100644 --- a/knotserver/routes.go +++ b/knotserver/routes.go @@ -228,7 +228,7 @@ func (h *Handle) BlobRaw(w http.ResponseWriter, r *http.Request) { mimeType := http.DetectContentType(contents) // exception for svg - if strings.HasPrefix(mimeType, "text/xml") && filepath.Ext(treePath) == ".svg" { + if filepath.Ext(treePath) == ".svg" { mimeType = "image/svg+xml" } -- 2.51.2