Skip to content

Commit

Permalink
fix: deepcopy doesn't copy the metatable
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
  • Loading branch information
spacewander committed Mar 16, 2022
1 parent 01da57f commit 765da79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apisix/core/table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ do
end
end

local mt = getmetatable(orig)
if mt ~= nil then
setmetatable(copy, mt)
end

return copy
end

Expand Down

0 comments on commit 765da79

Please # to comment.