mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-05 05:27:35 +08:00
fix: we didn't traverse the plugin interceptors correctly (#2462)
This bug is introduced in 6a543a9
.
This commit is contained in:
parent
71dcf367d3
commit
5906c73a07
@ -90,8 +90,8 @@ function fetch_api_router()
|
||||
local code, body
|
||||
|
||||
local metadata = plugin_mod.plugin_metadata(name)
|
||||
if metadata and metadata.interceptors then
|
||||
for _, rule in ipairs(metadata.interceptors) do
|
||||
if metadata and metadata.value.interceptors then
|
||||
for _, rule in ipairs(metadata.value.interceptors) do
|
||||
local f = interceptors[rule.name]
|
||||
if f == nil then
|
||||
core.log.error("unknown interceptor: ", rule.name)
|
||||
|
@ -309,7 +309,7 @@ passed
|
||||
=== TEST 10: hit prometheus route
|
||||
--- request
|
||||
GET /apisix/prometheus/metrics
|
||||
-- error_code: 403
|
||||
--- error_code: 403
|
||||
|
||||
|
||||
|
||||
@ -350,7 +350,7 @@ passed
|
||||
=== TEST 12: hit prometheus route again
|
||||
--- request
|
||||
GET /apisix/prometheus/metrics
|
||||
-- error_code: 200
|
||||
--- error_code: 200
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user