Firstsawyou commented on a change in pull request #2749:
URL: https://github.com/apache/apisix/pull/2749#discussion_r523887304



##########
File path: apisix/plugins/hmac-auth.lua
##########
@@ -194,14 +209,28 @@ local function generate_signature(ctx, secret_key, params)
         end
         core.table.sort(keys)
 
+        local field_val = get_conf_field(params.access_key, "enable_encode")
+        core.log.info("enable_encode: ", field_val)
+
         for _, key in pairs(keys) do
             local param = args[key]
-            if type(param) == "table" then
-                for _, val in pairs(param) do
-                    core.table.insert(query_tab, escape_uri(key) .. "=" .. 
escape_uri(val))
+            -- whether to escape the uri parameters
+            if field_val then

Review comment:
       @spacewander 
   You mean we need to use a function like this: `local function 
encode_or_not(key) return key end` . To handle the situation where this option 
is disabled?




----------------------------------------------------------------
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]


Reply via email to