MetaURLOrigin extracts the origin (scheme + host) from a URL for metadata purposes.
(fullURL string)
| 34 | |
| 35 | // MetaURLOrigin extracts the origin (scheme + host) from a URL for metadata purposes. |
| 36 | func MetaURLOrigin(fullURL string) string { |
| 37 | if u, err := url.Parse(fullURL); err == nil { |
| 38 | return u.Scheme + "://" + u.Host |
| 39 | } |
| 40 | |
| 41 | return "" |
| 42 | } |
no test coverage detected