tzssangglass commented on a change in pull request #2943:
URL: https://github.com/apache/apisix/pull/2943#discussion_r536806686
##########
File path: apisix/http/router/radixtree_host_uri.lua
##########
@@ -94,7 +94,11 @@ local function create_radixtree_router(routes)
host_router = nil
for _, route in ipairs(routes or {}) do
- push_host_router(route, host_routes, only_uri_routes)
+ local status = core.table.try_read_attr(route, "value", "status")
+ -- check the status
+ if status == 1 then
Review comment:
I took a look at the apisix sync data from etcd,
https://github.com/apache/apisix/blob/c41aa8534a18f43ef0c3cd6780f106595f9f9b88/apisix/core/schema.lua#L53-L61
after `validator(json) `, the existing old data will has default `status`
value.
but i agree your point, add `if not status` is more safer:-)
----------------------------------------------------------------
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:
[email protected]