dongeforever commented on a change in pull request #1149: [issue##1147]Broker 
will report Exception if open the aclEnable and enableDLegerCommitLog flag at 
the same time.
URL: https://github.com/apache/rocketmq/pull/1149#discussion_r274236907
 
 

 ##########
 File path: 
acl/src/main/java/org/apache/rocketmq/acl/plain/PlainAccessValidator.java
 ##########
 @@ -53,15 +53,17 @@ public AccessResource parse(RemotingCommand request, 
String remoteAddr) {
             accessResource.setWhiteRemoteAddress(remoteAddr);
         }
 
+        accessResource.setRequestCode(request.getCode());
+
         if (request.getExtFields() == null) {
-            throw new AclException("request's extFields value is null");
+            //If request's extFields is null,then return accessResource 
directly(users can use whiteAddress pattern)
+            return accessResource;
         }
 
 Review comment:
   It is vulnerable to return fast here, for it may miss something if adding 
some logic after the return,  the  
"accessResource.setRequestCode(request.getCode())" is the case, but not the 
only case.
   As the following code relies on that the getExtFields is not null, then use 
if statement is suggested, just as:
   if (request.getExtFields() != null) {
       
accessResource.setAccessKey(request.getExtFields().get(SessionCredentials.ACCESS_KEY));
      XXX
   }
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to