RockteMQ-AI commented on code in PR #2937:
URL:
https://github.com/apache/rocketmq-dashboard/pull/2937#discussion_r3909152817
##########
server/src/main/java/org/apache/rocketmq/studio/instance/message/QueryHistoryService.java:
##########
@@ -292,4 +293,19 @@ private static String escapeLike(String search) {
}
return search.replace("\\", "\\\\").replace("%", "\\%").replace("_",
"\\_");
}
+
+ /**
+ * The query types written by {@code MessageService#recordMessageQuery}.
The controller
+ * passes the raw user-supplied filter through, so an unknown value would
silently return
+ * an empty page instead of surfacing a 400.
+ */
+ private static void validateQueryType(String queryType) {
+ if (!StringUtils.hasText(queryType)) {
+ return;
+ }
+ if (!"MSG_ID".equals(queryType) && !"KEY".equals(queryType) &&
!"TOPIC".equals(queryType)) {
Review Comment:
StringUtils.hasText treats whitespace-only queryType as absent, so a value
like ' ' bypasses validation and still produces a silent empty page. Consider
trimming or also rejecting whitespace-only values.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]