bzp2010 commented on code in PR #2421:
URL: https://github.com/apache/apisix-dashboard/pull/2421#discussion_r874345460


##########
api/internal/core/entity/format.go:
##########
@@ -17,17 +17,23 @@
 package entity
 
 import (
-       "net"
+       "errors"
        "strconv"
+       "strings"
 
        "github.com/apisix/manager-api/internal/log"
 )
 
 func mapKV2Node(key string, val float64) (*Node, error) {
-       host, port, err := net.SplitHostPort(key)
-       if err != nil {
-               log.Errorf("split host port fail: %s", err)
-               return nil, err
+       hp := strings.Split(key, ":")
+       host := hp[0]
+       //  according to APISIX upstream nodes policy, port is optional
+       port := "0"

Review Comment:
   Is it appropriate to use port 0 by default? Should port 80 be used by 
default? 🤔



-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to