From 4c2cd5a534e81db884159c658bb5e921a89f1df8 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Thu, 21 Jul 2022 12:58:06 +0300 Subject: [PATCH] simplify the svg extension check --- tools/filesystem/filesystem.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/filesystem/filesystem.go b/tools/filesystem/filesystem.go index c214e7d5..7ead3c7f 100644 --- a/tools/filesystem/filesystem.go +++ b/tools/filesystem/filesystem.go @@ -199,9 +199,8 @@ func (s *System) Serve(response http.ResponseWriter, fileKey string, name string // make an exception for svg and use a custom content type // to send in the response so that it can be loaded in a img tag // (see https://github.com/whatwg/mimesniff/issues/7) - ext := filepath.Ext(name) extContentType := realContentType - if ext == ".svg" { + if filepath.Ext(name) == ".svg" { extContentType = "image/svg+xml" }