summaryrefslogtreecommitdiffstats
path: root/utils/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/utils.go')
-rw-r--r--utils/utils.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/utils.go b/utils/utils.go
index f34c82f24..038f6ab61 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -6,6 +6,7 @@ package utils
import (
"net"
"net/http"
+ "net/url"
"os"
"github.com/mattermost/platform/model"
@@ -66,3 +67,11 @@ func GetIpAddress(r *http.Request) string {
return address
}
+
+func GetSiteName(siteURL string) string {
+ u, err := url.Parse(siteURL)
+ if err != nil {
+ return ""
+ }
+ return u.Host
+}