spacewander commented on a change in pull request #3870:
URL: https://github.com/apache/apisix/pull/3870#discussion_r603046994



##########
File path: apisix/plugins/traffic-split.lua
##########
@@ -148,26 +148,18 @@ end
 
 
 local function set_pass_host(ctx, upstream_info, host)
-    -- Currently only supports a single upstream of the domain name.
-    -- When the upstream is `IP`, do not do any `pass_host` operation.
-    if not core.utils.parse_ipv4(host)
-       and not core.utils.parse_ipv6(host)
-    then
-        local pass_host = upstream_info.pass_host or "pass"
-        if pass_host == "pass" then
-            ctx.var.upstream_host = ctx.var.host
-            return
-        end
-
-        if pass_host == "rewrite" then
-            ctx.var.upstream_host = upstream_info.upstream_host
-            return
-        end
+    local pass_host = upstream_info.pass_host or "pass"
+    if pass_host == "pass" then
+        return
+    end
 
-        ctx.var.upstream_host = host
+    if pass_host == "rewrite" then
+        ctx.var.upstream_host = upstream_info.upstream_host
         return
     end
 
+    -- only support single node for `node` mode currently
+    ctx.var.upstream_host = host
     return

Review comment:
       We don't need an extra `return` at the end of the function.




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

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


Reply via email to