IsURLReference checks if the input is a valid HTTP/HTTPS URL.
(input string)
| 468 | |
| 469 | // IsURLReference checks if the input is a valid HTTP/HTTPS URL. |
| 470 | func IsURLReference(input string) bool { |
| 471 | return strings.HasPrefix(input, "http://") || strings.HasPrefix(input, "https://") |
| 472 | } |
| 473 | |
| 474 | // isLocalhostHTTP reports whether rawURL is an http:// URL targeting localhost. |
| 475 | func isLocalhostHTTP(rawURL string) bool { |
no outgoing calls