nic-6443 commented on code in PR #12714:
URL: https://github.com/apache/apisix/pull/12714#discussion_r2476881929


##########
apisix/upstream.lua:
##########
@@ -326,6 +327,13 @@ end
 
 
 function _M.check_schema(conf)
+    if conf.nodes then
+        for _, node in ipairs(conf.nodes) do
+            if core.utils.parse_ipv6(node.host) and str_byte(node.host, 1) ~= 
str_byte("[") then
+                return false, "IPv6 address must be enclosed with '[' and ']'"

Review Comment:
   We not only need to reject such configurations in the admin API, but also 
consider executing data correction code when watching for such configurations 
from etcd:
   ```
   node.host = '[' .. node.host .. ']'
   ```



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