MCPcopy Create free account
hub / github.com/coder/coder / ProviderBaseURLHostname

Function ProviderBaseURLHostname

coderd/x/chatd/chatprovider/chatprovider.go:191–197  ·  view source on GitHub ↗

ProviderBaseURLHostname returns the normalized hostname from a provider base URL.

(baseURL string)

Source from the content-addressed store, hash-verified

189
190// ProviderBaseURLHostname returns the normalized hostname from a provider base URL.
191func ProviderBaseURLHostname(baseURL string) string {
192 parsed, ok := parseProviderBaseURL(baseURL)
193 if !ok {
194 return ""
195 }
196 return strings.ToLower(parsed.Hostname())
197}
198
199func parseProviderBaseURL(baseURL string) (*neturl.URL, bool) {
200 baseURL = strings.TrimSpace(baseURL)

Callers 2

Calls 1

parseProviderBaseURLFunction · 0.85

Tested by 1