Skip to content

Commit

Permalink
Merge pull request #1170 from Netflix/qiangdavidliu-patch-4
Browse files Browse the repository at this point in the history
sanitize metadata map for empty values
  • Loading branch information
qiangdavidliu committed Jan 11, 2019
2 parents 1b60b49 + 6724f47 commit 48446d9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ public synchronized InstanceInfo get() {
for (Map.Entry<String, String> mapEntry : config.getMetadataMap().entrySet()) {
String key = mapEntry.getKey();
String value = mapEntry.getValue();
builder.add(key, value);
// only add the metadata if the value is present
if (value != null && !value.isEmpty()) {
builder.add(key, value);
}
}

instanceInfo = builder.build();
Expand Down

0 comments on commit 48446d9

Please sign in to comment.