MCPcopy Create free account
hub / github.com/cli/cli / isJupyterServerURLValid

Function isJupyterServerURLValid

internal/codespaces/rpc/invoker.go:321–335  ·  view source on GitHub ↗

Ensures that the Jupyter server URL is valid and points to a loopback http(s) URL

(serverURL string)

Source from the content-addressed store, hash-verified

319
320// Ensures that the Jupyter server URL is valid and points to a loopback http(s) URL
321func isJupyterServerURLValid(serverURL string) bool {
322 u, err := url.Parse(serverURL)
323 if err != nil {
324 return false
325 }
326 if u.Scheme != "http" && u.Scheme != "https" {
327 return false
328 }
329 host := u.Hostname()
330 if strings.ToLower(host) == "localhost" {
331 return true
332 }
333 ip := net.ParseIP(host)
334 return ip != nil && ip.IsLoopback()
335}

Callers 2

StartJupyterServerMethod · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…