You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org> on 2023/09/25 06:25:31 UTC

[GitHub] [apisix] monkeyDluffy6017 commented on a diff in pull request #9995: fix: safely check for upstream field in traffic split plugin

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


##########
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:
   We cannot just add the check here,  The `upstream_obj.upstream` is used in other parts of the code as well



-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org