Skip to content

Commit

Permalink
bug :: preserve original behavior for getStringParameter and return n…
Browse files Browse the repository at this point in the history
…ull not an empty string
  • Loading branch information
dev-mlb committed Dec 27, 2024
1 parent 2f072d9 commit 0033170
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/emissary/core/BaseDataObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ public String getParameterAsString(final String key) {
if (obj.size() > 1) {
logger.warn("Multiple values for parameter, returning the first - parameter:{}, number of values:{}", key, obj.size());
}
return StringUtils.trimToNull(obj.stream().findFirst().orElse(null));
return obj.stream().findFirst().orElse(null);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/emissary/core/BaseDataObjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ void testGetParameterAsString() throws IOException {
assertNull(this.b.getParameterAsConcatString("A"));

this.b.putParameter("A", "");
assertNull(this.b.getParameterAsString("A"));
assertEquals("", this.b.getParameterAsString("A"));
assertEquals("", this.b.getParameterAsConcatString("A"));

assertNull(this.b.getParameterAsString("DNE"));
Expand Down

0 comments on commit 0033170

Please sign in to comment.