From 18fe37df5345e044b5ac79f74e6a8046d0e6e138 Mon Sep 17 00:00:00 2001 From: Anton Mostovoy Date: Wed, 4 Jan 2023 10:12:45 -0600 Subject: [PATCH] fix #288 --- .../sdk/server/integrations/FileDataSourceParsing.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceParsing.java b/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceParsing.java index cca8aac93..37e0bda41 100644 --- a/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceParsing.java +++ b/src/main/java/com/launchdarkly/sdk/server/integrations/FileDataSourceParsing.java @@ -10,7 +10,9 @@ import com.launchdarkly.sdk.server.subsystems.DataStoreTypes.ItemDescriptor; import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.error.YAMLException; +import org.yaml.snakeyaml.representer.Representer; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -149,7 +151,7 @@ public FlagFileRep parseJson(JsonElement tree) throws FileDataException, IOExcep * */ static final class YamlFlagFileParser extends FlagFileParser { - private static final Yaml yaml = new Yaml(); + private static final Yaml yaml = new Yaml(new SafeConstructor(), new Representer()); private static final Gson gson = new Gson(); private static final JsonFlagFileParser jsonFileParser = new JsonFlagFileParser();