You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/09/07 15:34:08 UTC

[GitHub] [druid] cryptoe commented on a diff in pull request #13045: fix bug in /status/properties filtering

cryptoe commented on code in PR #13045:
URL: https://github.com/apache/druid/pull/13045#discussion_r964998814


##########
server/src/main/java/org/apache/druid/server/StatusResource.java:
##########
@@ -92,15 +93,15 @@ private Map<String, String> filterHiddenProperties(
       Map<String, String> allProperties
   )
   {
-    return Maps.filterEntries(
-        allProperties,
-        (entry) -> hiddenProperties
-            .stream()
-            .anyMatch(
-                hiddenPropertyElement ->
-                    !StringUtils.toLowerCase(entry.getKey()).contains(StringUtils.toLowerCase(hiddenPropertyElement))
-            )
+    Map<String, String> propertyCopy = new HashMap<>(allProperties);
+    allProperties.keySet().forEach(
+        (key) -> {
+          if (hiddenProperties.stream().anyMatch((hiddenProperty) -> StringUtils.toLowerCase(key).contains(StringUtils.toLowerCase(hiddenProperty)))) {

Review Comment:
   nit: So if we have set of hiddenProps as =["pwd"] and in the allProperties we have {"foopwd"->"secret1" , "pwd"->"secret", "foo"->"bar"  } the output would be {"foo"->"bar"} . 
   In that case, we should update a JavaDoc to reflect this 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org