leslie-tsang commented on a change in pull request #5163:
URL: https://github.com/apache/apisix/pull/5163#discussion_r719349520



##########
File path: apisix/upstream.lua
##########
@@ -112,7 +112,7 @@ local function create_checker(upstream)
     local host = upstream.checks and upstream.checks.active and 
upstream.checks.active.host
     local port = upstream.checks and upstream.checks.active and 
upstream.checks.active.port
     for _, node in ipairs(upstream.nodes) do
-        local ok, err = checker:add_target(node.host, port or node.port, host)
+        local ok, err = checker:add_target(node.host, port or node.port, host, 
true, hostheader)

Review comment:
       I am afraid this can't be done as easily as this. Ref to
   
https://github.com/Kong/lua-resty-healthcheck/blob/e1f2196faa7d57f2ad62fa5d0ed2b59beeb8396d/lib/resty/healthcheck.lua#L297-L311
   
   ```suggestion
           local ok, err = checker:add_target(node.host, port or node.port, 
host, hostheader)
   ```
   Maybe this will work as expected?

##########
File path: apisix/upstream.lua
##########
@@ -112,7 +112,7 @@ local function create_checker(upstream)
     local host = upstream.checks and upstream.checks.active and 
upstream.checks.active.host
     local port = upstream.checks and upstream.checks.active and 
upstream.checks.active.port
     for _, node in ipairs(upstream.nodes) do
-        local ok, err = checker:add_target(node.host, port or node.port, host)
+        local ok, err = checker:add_target(node.host, port or node.port, host, 
true, hostheader)

Review comment:
       BTW, use `hostname` instead of `hostheader` will be better. func 
`add_target` third params original name is `hostname`.




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