Skip to content

Commit

Permalink
move logic to deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
Revolyssup committed Dec 23, 2024
1 parent 8900fa1 commit 0ca4ee3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions apisix/control/router.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ do
if type(body) == "table" and ngx.header["Content-Type"] == nil then
core.response.set_header("Content-Type", "application/json")
end
if type(body) == "table" then
body.checker = nil
body.checker_idx = nil
body.checker_upstream = nil
if body.clean_handlers then
body.clean_handlers = {}
end
end
core.response.exit(code, body)
end
end
Expand Down
8 changes: 8 additions & 0 deletions apisix/control/v1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ local function iter_add_get_routes_info(values, route_id)
if new_route.value.upstream and new_route.value.upstream.parent then
new_route.value.upstream.parent = nil
end
-- remove healthcheck info
new_route.checker = nil
new_route.checker_idx = nil
new_route.checker_upstream = nil

if new_route.clean_handlers then
new_route.clean_handlers = {}
end
core.table.insert(infos, new_route)
-- check the route id
if route_id and route.value.id == route_id then
Expand Down

0 comments on commit 0ca4ee3

Please sign in to comment.