Skip to content

Commit

Permalink
fix: always parse domain when host is domain name (#9332)
Browse files Browse the repository at this point in the history
  • Loading branch information
okaybase authored May 6, 2023
1 parent 20cb140 commit 6b66fb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apisix/plugins/traffic-split.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions t/plugin/traffic-split.t
Original file line number Diff line number Diff line change
Expand Up @@ -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}/



Expand Down

0 comments on commit 6b66fb5

Please sign in to comment.