This is an automated email from the ASF dual-hosted git repository.
monkeydluffy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 6b66fb5a1 fix: always parse domain when host is domain name (#9332)
6b66fb5a1 is described below
commit 6b66fb5a1114d473eaac16b0c8d9214e7953b74c
Author: okaybase <[email protected]>
AuthorDate: Sat May 6 09:23:48 2023 +0800
fix: always parse domain when host is domain name (#9332)
---
apisix/plugins/traffic-split.lua | 2 +-
t/plugin/traffic-split.t | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/apisix/plugins/traffic-split.lua b/apisix/plugins/traffic-split.lua
index 38e272b7b..18a6be6d0 100644
--- a/apisix/plugins/traffic-split.lua
+++ b/apisix/plugins/traffic-split.lua
@@ -125,7 +125,7 @@ end
local function parse_domain_for_node(node)
- local host = node.host
+ local host = node.domain or node.host
if not ipmatcher.parse_ipv4(host)
and not ipmatcher.parse_ipv6(host)
then
diff --git a/t/plugin/traffic-split.t b/t/plugin/traffic-split.t
index f79152fd8..4a56988e8 100644
--- a/t/plugin/traffic-split.t
+++ b/t/plugin/traffic-split.t
@@ -710,11 +710,12 @@ passed
=== TEST 19: domain name resolved successfully
---- request
-GET /
---- error_code: 200
---- error_log eval
-qr/dns resolver domain: www.apiseven.com to \d+.\d+.\d+.\d+/
+--- pipelined_requests eval
+["GET /", "GET /"]
+--- error_code eval
+[200, 200]
+--- error_log_like eval
+qr/(dns resolver domain: www.apiseven.com to \d+.\d+.\d+.\d+){2}/