in internal/search/grpc.go [310:335]
func parseEndpoint(endpoint string) (EndpointInfo, error) {
// Store the original endpoint
info := EndpointInfo{
Original: endpoint,
}
// Determine protocol
if strings.HasPrefix(endpoint, "https://") {
info.Protocol = "https"
} else if strings.HasPrefix(endpoint, "http://") {
info.Protocol = "http"
} else {
return info, errors.New("unknown protocol")
}
endpoint = strings.TrimPrefix(endpoint, info.Protocol+"://")
// Split into host:port and path parts
parts := strings.SplitN(endpoint, "/", 2)
info.HostPort = parts[0]
if len(parts) > 1 {
info.Path = "/" + parts[1]
}
return info, nil
}