@@ -170,9 +170,9 @@ func GetServiceEndpoint(config *Environments, serviceName string) (string, error
170170}
171171
172172func FetchEndpointsMap (endpoint string ) (map [string ]string , error ) {
173- if strings .HasPrefix (endpoint , "grpc://" ) {
173+ if strings .HasPrefix (endpoint , "grpc://localhost " ) {
174174 endpointsMap := make (map [string ]string )
175- endpointsMap ["local " ] = endpoint
175+ endpointsMap ["static " ] = endpoint
176176 return endpointsMap , nil
177177 }
178178
@@ -187,16 +187,21 @@ func FetchEndpointsMap(endpoint string) (map[string]string, error) {
187187
188188 if ! hasIdentityService {
189189 // Handle gRPC+SSL protocol directly
190- if strings .HasPrefix (endpoint , "grpc+ssl://" ) {
190+ if strings .HasPrefix (endpoint , "grpc+ssl://" ) || strings .HasPrefix (endpoint , "grpc://" ) {
191+ protocol := "grpc+ssl://"
192+ if strings .HasPrefix (endpoint , "grpc://" ) {
193+ protocol = "grpc://"
194+ }
195+
191196 // Parse the endpoint
192- parts := strings .Split (endpoint , "/" )
193- endpoint = strings .Join (parts [:len (parts )- 1 ], "/" )
194- parts = strings .Split (endpoint , "://" )
195- if len (parts ) != 2 {
197+ hostPart := strings .TrimPrefix (endpoint , protocol )
198+ hostPart = strings .TrimSuffix (hostPart , "/" )
199+
200+ hostParts := strings .Split (hostPart , "." )
201+ if len (hostParts ) == 0 {
196202 return nil , fmt .Errorf ("invalid endpoint format: %s" , endpoint )
197203 }
198204
199- hostParts := strings .Split (parts [1 ], "." )
200205 svc := hostParts [0 ]
201206 baseDomain := strings .Join (hostParts [1 :], "." )
202207
0 commit comments