You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2023/02/11 05:10:37 UTC

[rocketmq] branch develop updated: [ISSUE #6019] simplified the PlainAccessResource parse method

This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4cfd54f53 [ISSUE #6019] simplified the PlainAccessResource parse method
4cfd54f53 is described below

commit 4cfd54f533925231b84194c481ffb42a1fe8fb80
Author: hardyfish <85...@users.noreply.github.com>
AuthorDate: Sat Feb 11 13:10:31 2023 +0800

    [ISSUE #6019] simplified the PlainAccessResource parse method
---
 .../java/org/apache/rocketmq/acl/plain/PlainAccessResource.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainAccessResource.java b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainAccessResource.java
index a23faab7d..046a7d954 100644
--- a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainAccessResource.java
+++ b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainAccessResource.java
@@ -178,14 +178,14 @@ public class PlainAccessResource implements AccessResource {
         // Content
         SortedMap<String, String> map = new TreeMap<>();
         for (Map.Entry<String, String> entry : request.getExtFields().entrySet()) {
+            if (request.getVersion() <= MQVersion.Version.V4_9_3.ordinal() &&
+                    MixAll.UNIQUE_MSG_QUERY_FLAG.equals(entry.getKey())) {
+                continue;
+            }
             if (!SessionCredentials.SIGNATURE.equals(entry.getKey())) {
                 map.put(entry.getKey(), entry.getValue());
             }
         }
-        if (request.getVersion() <= MQVersion.Version.V4_9_3.ordinal()
-            && map.containsKey(MixAll.UNIQUE_MSG_QUERY_FLAG)) {
-            map.remove(MixAll.UNIQUE_MSG_QUERY_FLAG);
-        }
         accessResource.setContent(AclUtils.combineRequestContent(request, map));
         return accessResource;
     }