Skip to content

fix: correcting protocol parsing logic that may lead to incorrect sanitization of an incoming message from LD servers #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ public static EnvironmentData fromJson(String json) throws SerializationExceptio
// Normalize the data set to ensure that the flag keys are present not only as map keys,
// but also in each Flag object. That is normally the case in data sent by LD, even though
// it's redundant, but if for any reason it isn't we can transparently fix it.
for (Map.Entry<String, Flag> e: dataMap.entrySet()) {
Flag f = e.getValue();
for (Map.Entry<String, Flag> entry: dataMap.entrySet()) {
Flag f = entry.getValue();
if (f.getKey() == null) {
f = new Flag(e.getKey(), f.getValue(), f.getVersion(), f.getFlagVersion(),
f = new Flag(entry.getKey(), f.getValue(), f.getVersion(), f.getFlagVersion(),
f.getVariation(), f.isTrackEvents(), f.isTrackReason(), f.getDebugEventsUntilDate(),
f.getReason(), f.getPrerequisites());
dataMap.put(e.getKey(), f);
entry.setValue(f);
}
}
return new EnvironmentData(dataMap);
Expand Down
Loading