monkeyDluffy6017 commented on code in PR #9995:
URL: https://github.com/apache/apisix/pull/9995#discussion_r1300835826


##########
apisix/plugins/traffic-split.lua:
##########
@@ -200,7 +200,7 @@ local function new_rr_obj(weighted_upstreams)
     for i, upstream_obj in ipairs(weighted_upstreams) do
         if upstream_obj.upstream_id then
             server_list[upstream_obj.upstream_id] = upstream_obj.weight
-        elseif upstream_obj.upstream then
+        elseif upstream_obj.upstream and type(upstream_obj.upstream) == 
"table" then

Review Comment:
   It doesn't fix the user's problem, the `upstream` property shouldn't be a 
string, if we add the judgement here, it will cause other problem elsewhere



##########
apisix/plugins/traffic-split.lua:
##########
@@ -200,7 +200,7 @@ local function new_rr_obj(weighted_upstreams)
     for i, upstream_obj in ipairs(weighted_upstreams) do
         if upstream_obj.upstream_id then
             server_list[upstream_obj.upstream_id] = upstream_obj.weight
-        elseif upstream_obj.upstream then
+        elseif upstream_obj.upstream and type(upstream_obj.upstream) == 
"table" then

Review Comment:
   It doesn't fix the user's problem, the `upstream` property shouldn't be a 
string, if we add the judgement here, it will cause problems elsewhere



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to