From c64a8e7a63b1400f31b45f15036284eb1077c233 Mon Sep 17 00:00:00 2001 From: Justin Hawkins Date: Wed, 27 Nov 2024 18:02:23 +1030 Subject: [PATCH] Base64 encode SVG's too, to avoid things like '%' breaking. --- tools/tools.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools.go b/tools/tools.go index c8d2ec0..cb343dd 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -25,5 +25,5 @@ func ImageToPayload(i image.Image) string { // SVGToPayload create the string necessary to send an SVG // via a ESSetImage struct func SVGToPayload(svg string) string { - return "data:image/svg+xml;charset=utf8," + svg + return "data:image/svg+xml;charset=utf8;base64," + base64.StdEncoding.EncodeToString([]byte(svg)) }