From 7eff78e8702dfea984113f7d6b91123b6fdc1432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Tue, 10 Feb 2026 15:14:01 +0100 Subject: [PATCH] FileContent: tolerant base64 reader --- config/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 8f6b79e..dfde93c 100644 --- a/config/config.go +++ b/config/config.go @@ -6,6 +6,7 @@ import ( "io" "net" "os" + "strings" "time" yaml "gopkg.in/yaml.v2" @@ -157,11 +158,13 @@ type NetworkDef struct { Script string } +var b64 = base64.RawStdEncoding + func (c *Config) FileContent(filePath string) []byte { for _, f := range c.Files { if f.Path == filePath { if f.Content64 != "" { - decoded, err := base64.StdEncoding.DecodeString(f.Content64) + decoded, err := b64.DecodeString(strings.TrimRight(f.Content64, "=")) if err != nil { panic(fmt.Errorf("invalid base64 content in file %s", f.Path)) }