(rawURL string)
| 111 | } |
| 112 | |
| 113 | func getBaseURL(rawURL string) (string, error) { |
| 114 | u, err := url.Parse(rawURL) |
| 115 | if err != nil { |
| 116 | return "", errors.Wrap(err, "parsing url") |
| 117 | } |
| 118 | |
| 119 | if u.Scheme == "" || u.Host == "" { |
| 120 | return "", nil |
| 121 | } |
| 122 | |
| 123 | return fmt.Sprintf("%s://%s", u.Scheme, u.Host), nil |
| 124 | } |
| 125 | |
| 126 | func getServerDisplayURL(ctx context.DnoteCtx) string { |
| 127 | baseURL, err := getBaseURL(ctx.APIEndpoint) |
no outgoing calls
no test coverage detected