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 2021/02/18 02:55:27 UTC

[GitHub] [apisix] tokers commented on a change in pull request #3595: fix: should assign value to `api_ctx.global_rules` before running global rules

tokers commented on a change in pull request #3595:
URL: https://github.com/apache/apisix/pull/3595#discussion_r578092058



##########
File path: apisix/plugin.lua
##########
@@ -689,6 +689,10 @@ function _M.run_global_rules(api_ctx, global_rules, phase_name)
         local orig_conf_version = api_ctx.conf_version
         local orig_conf_id = api_ctx.conf_id
 
+        if phase_name == "access" then

Review comment:
       Why not assign it before you call `run_global_rules` in the access phase, instead of check the phase every time the `run_global_rules` are called.




----------------------------------------------------------------
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:
users@infra.apache.org