From ab4e9b2ecc27f7e2e7dd59fe3b833e785d81146f Mon Sep 17 00:00:00 2001 From: Scott Mitchell Date: Fri, 20 Sep 2024 22:15:06 -0400 Subject: [PATCH] HttpRequestMetaData#hasQueryParameter(String) default implementation 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. --- .../main/java/io/servicetalk/http/api/HttpRequestMetaData.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpRequestMetaData.java b/servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpRequestMetaData.java index 73cff576c0..eec49a6951 100644 --- a/servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpRequestMetaData.java +++ b/servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpRequestMetaData.java @@ -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); } /**