fix: add support for url-encoded vector-sink config values

We additionally force-replace \u0026 with an ampersand to ensure we properly support & in config values (such as for URIs).
This commit is contained in:
Jose Diaz-Gonzalez
2021-09-10 23:04:41 -04:00
parent 2c4fec77bb
commit 0997fd3347
3 changed files with 38 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package logs
import (
"bytes"
"encoding/json"
"errors"
"fmt"
@@ -217,6 +218,8 @@ func writeVectorConfig() error {
return err
}
b = bytes.Replace(b, []byte("\\u0026"), []byte("&"), -1)
vectorConfig := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "logs", "vector.json")
if err := common.WriteSliceToFile(vectorConfig, []string{string(b)}); err != nil {
return err