diff options
author | Elias Nahum <nahumhbl@gmail.com> | 2016-03-11 00:14:55 -0300 |
---|---|---|
committer | Elias Nahum <nahumhbl@gmail.com> | 2016-03-17 13:20:17 -0300 |
commit | 1f5c8c4e4ebb2e163278f3e62d640f41a2df7294 (patch) | |
tree | a659674c9980e23752fc8d9f07eb48014c8bce26 /model/utils.go | |
parent | d383ed2f8dfc320c090b67d9f2e2d111710ca3cf (diff) | |
download | chat-1f5c8c4e4ebb2e163278f3e62d640f41a2df7294.tar.gz chat-1f5c8c4e4ebb2e163278f3e62d640f41a2df7294.tar.bz2 chat-1f5c8c4e4ebb2e163278f3e62d640f41a2df7294.zip |
Option to enable full snippets in push notifications
Diffstat (limited to 'model/utils.go')
-rw-r--r-- | model/utils.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/model/utils.go b/model/utils.go index 808c89e30..1ce41bb30 100644 --- a/model/utils.go +++ b/model/utils.go @@ -367,3 +367,15 @@ func IsValidHttpUrl(rawUrl string) bool { return true } + +func IsValidHttpsUrl(rawUrl string) bool { + if strings.Index(rawUrl, "https://") != 0 { + return false + } + + if _, err := url.ParseRequestURI(rawUrl); err != nil { + return false + } + + return true +} |