validateHTTPURL does a sanity check that a URL returns a 200 or 300 response
(url string)
| 316 | |
| 317 | // validateHTTPURL does a sanity check that a URL returns a 200 or 300 response |
| 318 | func validateHTTPURL(url string) error { |
| 319 | resp, err := http.Head(url) |
| 320 | if err != nil { |
| 321 | return err |
| 322 | } |
| 323 | if resp.StatusCode >= 400 { |
| 324 | return fmt.Errorf("got a non 200- or 300- HTTP response code: %s", resp.Status) |
| 325 | } |
| 326 | return nil |
| 327 | } |
| 328 | |
| 329 | func equinixmetalSOS(user, host string) error { |
| 330 | log.Debugf("console: ssh %s@%s", user, host) |
no test coverage detected