bzp2010 commented on code in PR #12304:
URL: https://github.com/apache/apisix/pull/12304#discussion_r2149166412
##########
apisix/discovery/consul/init.lua:
##########
@@ -516,6 +516,10 @@ function _M.connect(premature, consul_server, retry_delay)
end
local svc_address, svc_port = node.Service.Address,
node.Service.Port
+ -- Handle nil or 0 port case - default to 80 for HTTP
services
+ if not svc_port or svc_port == 0 then
Review Comment:
We have verified that nginx/openresty does not allow `0` as a port, even
though TCP/UDP is designed to allow it.
As verified by @oil-oil, Consul's default behavior on Port has changed; it
used to be `null` when registered without entering it; now it auto-populates
with `0` as the default.
Since APISIX is primarily oriented towards HTTP scenarios, we fallback to
`80` (the HTTP default) if the Port is `null` (the old behavior) or `0` (the
new behavior, but not allowed by nginx).
This behavior needs to be documented.
--
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]