Skip to content

Commit

Permalink
Use same escape strategy for key and value
Browse files Browse the repository at this point in the history
  • Loading branch information
Snarr committed Nov 20, 2024
1 parent 5f973a4 commit 181856c
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ public void initFrom(Message proto, ExecutionContext context) {
}

public String getEscapedKey() {
if (key == null) return null;
return key.replace("_", "\\_");
return escapeString(key);
}

public String getEscapedVal() {
if (val == null) return null;
return val.replace("_", "\\_");
return escapeString(val);
}

public String escapeString(String str) {
if (str == null) return null;
return str.replace("_", "\\_");
}

public static Attribute fromProto(AttributePb p, ExecutionContext context) {
Expand Down

0 comments on commit 181856c

Please sign in to comment.