kevinw66 commented on pull request #6314:
URL: https://github.com/apache/apisix/pull/6314#issuecomment-1039764699


   > 
   
   
   
   > Hi! Thanks for detecting the issue and the PR. After looking into the 
codebase, I find the way of forming the canonical query string unnecessarily 
complex yet it's not accurate. I would go with a simpler approach rather than 
pathing this up.
   > 
   > We can replace:
   > 
   > 
https://github.com/apache/apisix/blob/605141cba33beccf71100fdea03c8e9608d4852f/apisix/plugins/hmac-auth.lua#L219-L255
   > 
   > 
   > with
   > 
https://github.com/apache/apisix/blob/605141cba33beccf71100fdea03c8e9608d4852f/apisix/plugins/aws-lambda.lua#L123-L130
   > 
   > 
   > It's very simple, yet effective.
   > cc @spacewander to share your views.
   
   This may still need to check table param
   ```lua
   for k, v in pairs(args) do
       if type(v) == "table" then
           for _, sv in pairs(v) do
               canonical_qs[#canonical_qs+1] = ngx.unescape_uri(k) .. "=" .. 
ngx.unescape_uri(sv)
           end
       else
           canonical_qs[#canonical_qs+1] = ngx.unescape_uri(k) .. "=" .. 
ngx.unescape_uri(v)
       end
   end
   ```


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


Reply via email to