Skip to content

Commit

Permalink
HttpRequestMetaData#hasQueryParameter(String) default implementation …
Browse files Browse the repository at this point in the history
…fix (#3061)

Motivation:
Null key support was added for query parameters but the
default method implementation was not updated, and so it
returns incorrect results if a key has a null value.

Modifications:
- Use queryParametersKeys() to determine if key is present.
  • Loading branch information
Scottmitch authored Sep 21, 2024
1 parent 34a0849 commit ab4e9b2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ public interface HttpRequestMetaData extends HttpMetaData {
*/
default boolean hasQueryParameter(final String key) {
// FIXME: 0.43 - remove default, force implementations to implement.
// null value support was added and this method is now incorrect as default
return queryParameter(key) != null;
return queryParametersKeys().contains(key);
}

/**
Expand Down

0 comments on commit ab4e9b2

Please sign in to comment.