Unverified Commit 3427ae75 authored by Liu Chao's avatar Liu Chao Committed by GitHub

fix: resolve gRPC Gateway connection issue when server address is empty (#4968)

Signed-off-by: 's avatarChaoLiu <chaoliu719@gmail.com>
parent 506b477d
......@@ -67,7 +67,11 @@ func NewAPIV1Service(secret string, profile *profile.Profile, store *store.Store
func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Echo) error {
var target string
if len(s.Profile.UNIXSock) == 0 {
target = fmt.Sprintf("%s:%d", s.Profile.Addr, s.Profile.Port)
addr := s.Profile.Addr
if addr == "" {
addr = "localhost"
}
target = fmt.Sprintf("%s:%d", addr, s.Profile.Port)
} else {
target = fmt.Sprintf("unix:%s", s.Profile.UNIXSock)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment