|
|
@@ -83,6 +83,11 @@ func Domain(websiteURL string) string {
|
|
|
return parsedURL.Host
|
|
|
}
|
|
|
|
|
|
+// DomainWithoutWWW returns only the domain part of the given URL, with the "www." prefix removed if present.
|
|
|
+func DomainWithoutWWW(websiteURL string) string {
|
|
|
+ return strings.TrimPrefix(Domain(websiteURL), "www.")
|
|
|
+}
|
|
|
+
|
|
|
// JoinBaseURLAndPath returns a URL string with the provided path elements joined together.
|
|
|
func JoinBaseURLAndPath(baseURL, path string) (string, error) {
|
|
|
if baseURL == "" {
|