-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Steps to reproduce:
- Add global routes (such as prometheus)
- Delete some global routes
- User request, we can see the response 500 error.
One photo from community:
This patch should be fine, and we need to add test case for confirming.
[proxychains] DLL init
diff --git a/apisix/init.lua b/apisix/init.lua
index aa8598e8..1e6b1efb 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -264,14 +264,16 @@ function _M.http_access_phase()
and #router.global_rules.values > 0 then
local plugins = core.tablepool.fetch("plugins", 32, 0)
for _, global_rule in ipairs(router.global_rules.values) do
- api_ctx.conf_type = "global_rule"
- api_ctx.conf_version = global_rule.modifiedIndex
- api_ctx.conf_id = global_rule.value.id
-
- core.table.clear(plugins)
- api_ctx.plugins = plugin.filter(global_rule, plugins)
- run_plugin("rewrite", plugins, api_ctx)
- run_plugin("access", plugins, api_ctx)
+ if type(global_rule) == "table" then
+ api_ctx.conf_type = "global_rule"
+ api_ctx.conf_version = global_rule.modifiedIndex
+ api_ctx.conf_id = global_rule.value.id
+
+ core.table.clear(plugins)
+ api_ctx.plugins = plugin.filter(global_rule, plugins)
+ run_plugin("rewrite", plugins, api_ctx)
+ run_plugin("access", plugins, api_ctx)
+ end
end
core.tablepool.release("plugins", plugins)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working