diff --git a/apisix/http/router/radixtree_host_uri.lua b/apisix/http/router/radixtree_host_uri.lua index 71eea37450fa..680a04fbe815 100644 --- a/apisix/http/router/radixtree_host_uri.lua +++ b/apisix/http/router/radixtree_host_uri.lua @@ -143,7 +143,7 @@ local function create_radixtree_router(routes) end function _M.match(api_ctx) - local user_routes = core.table.deepcopy(_M.user_routes) + local user_routes = _M.user_routes local _, service_version = get_services() if not cached_router_version or cached_router_version ~= user_routes.conf_version or not cached_service_version or cached_service_version ~= service_version diff --git a/apisix/http/router/radixtree_uri.lua b/apisix/http/router/radixtree_uri.lua index f4862978677e..7c1b5c0c147a 100644 --- a/apisix/http/router/radixtree_uri.lua +++ b/apisix/http/router/radixtree_uri.lua @@ -28,7 +28,7 @@ local _M = {version = 0.2} local uri_routes = {} local uri_router function _M.match(api_ctx) - local user_routes = core.table.deepcopy(_M.user_routes) + local user_routes = _M.user_routes local _, service_version = get_services() if not cached_router_version or cached_router_version ~= user_routes.conf_version or not cached_service_version or cached_service_version ~= service_version diff --git a/apisix/http/router/radixtree_uri_with_parameter.lua b/apisix/http/router/radixtree_uri_with_parameter.lua index 1ffeb6efbc42..3f10f4fcac49 100644 --- a/apisix/http/router/radixtree_uri_with_parameter.lua +++ b/apisix/http/router/radixtree_uri_with_parameter.lua @@ -28,7 +28,7 @@ local _M = {} local uri_routes = {} local uri_router function _M.match(api_ctx) - local user_routes = core.table.deepcopy(_M.user_routes) + local user_routes = _M.user_routes local _, service_version = get_services() if not cached_router_version or cached_router_version ~= user_routes.conf_version or not cached_service_version or cached_service_version ~= service_version diff --git a/apisix/init.lua b/apisix/init.lua index 103a8c1d7584..c61ee5ce2aac 100644 --- a/apisix/init.lua +++ b/apisix/init.lua @@ -493,7 +493,7 @@ function _M.handle_upstream(api_ctx, route, enable_websocket) api_ctx.matched_route = route end - local route_val = route.value + local route_val = core.table.deepcopy(route.value) api_ctx.matched_upstream = (route.dns_value and route.dns_value.upstream)