yx9o commented on code in PR #5775:
URL: https://github.com/apache/rocketmq/pull/5775#discussion_r1058014034
##########
proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/common/GrpcValidator.java:
##########
@@ -106,16 +100,17 @@ public void validateInvisibleTime(long invisibleTime,
long minInvisibleTime) {
}
public void validateTag(String tag) {
- if (StringUtils.isNotEmpty(tag)) {
- if (StringUtils.isBlank(tag)) {
- throw new GrpcProxyException(Code.ILLEGAL_MESSAGE_TAG, "tag
cannot be the char sequence of whitespace");
- }
- if (tag.contains("|")) {
- throw new GrpcProxyException(Code.ILLEGAL_MESSAGE_TAG, "tag
cannot contain '|'");
- }
- if (containControlCharacter(tag)) {
- throw new GrpcProxyException(Code.ILLEGAL_MESSAGE_TAG, "tag
cannot contain control character");
- }
+ if (StringUtils.isEmpty(tag)) {
+ return;
+ }
+ if (StringUtils.isBlank(tag)) {
+ throw new GrpcProxyException(Code.ILLEGAL_MESSAGE_TAG, "tag cannot
be the char sequence of whitespace");
+ }
+ if (tag.contains("|")) {
+ throw new GrpcProxyException(Code.ILLEGAL_MESSAGE_TAG, "tag cannot
contain '|'");
+ }
+ if (containControlCharacter(tag)) {
+ throw new GrpcProxyException(Code.ILLEGAL_MESSAGE_TAG, "tag cannot
contain control character");
Review Comment:
Ok, thanks for your review, I modified it and I will add it to a new issue.
--
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]