You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/02/15 06:51:40 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #6314: fix(hmac-auth): hmac-auth plugin sort array param

spacewander commented on a change in pull request #6314:
URL: https://github.com/apache/apisix/pull/6314#discussion_r806493438



##########
File path: apisix/plugins/hmac-auth.lua
##########
@@ -244,7 +244,13 @@ local function generate_signature(ctx, secret_key, params)
 
             -- whether to encode the uri parameters
             if type(param) == "table" then
+                local vals = {}
                 for _, val in pairs(param) do
+                    core.table.insert(vals, val)

Review comment:
       Remember to convert boolean to `''` before sorting. `table.sort` only supports sorting in the same type.




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org