Ensures that the Jupyter server URL is valid and points to a loopback http(s) URL
(serverURL string)
| 319 | |
| 320 | // Ensures that the Jupyter server URL is valid and points to a loopback http(s) URL |
| 321 | func 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 | } |
no outgoing calls
searching dependent graphs…