diff options
author | =Corey Hulen <corey@hulen.com> | 2015-07-22 18:05:44 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-07-22 18:05:44 -0800 |
commit | c277a98b5d88c81df39f8e33ef1286f72ac04014 (patch) | |
tree | 0d96238a2ee3ab121ea576db9900311ff5a57ba6 /utils | |
parent | e0bad6c03784d44210760577550be585daf513b9 (diff) | |
parent | f4c3eaa8c091366a956fa2ab48124190f4f9082b (diff) | |
download | chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.tar.gz chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.tar.bz2 chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.zip |
Merge branch 'master' into mm-1420
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.go | 22 | ||||
-rw-r--r-- | utils/urlencode.go | 19 |
2 files changed, 31 insertions, 10 deletions
diff --git a/utils/config.go b/utils/config.go index efa4b263a..e8fa9a477 100644 --- a/utils/config.go +++ b/utils/config.go @@ -18,16 +18,18 @@ const ( ) type ServiceSettings struct { - SiteName string - Mode string - AllowTesting bool - UseSSL bool - Port string - Version string - InviteSalt string - PublicLinkSalt string - ResetSalt string - AnalyticsUrl string + SiteName string + Mode string + AllowTesting bool + UseSSL bool + Port string + Version string + InviteSalt string + PublicLinkSalt string + ResetSalt string + AnalyticsUrl string + UseLocalStorage bool + StorageDirectory string } type SqlSettings struct { diff --git a/utils/urlencode.go b/utils/urlencode.go new file mode 100644 index 000000000..63a8f7880 --- /dev/null +++ b/utils/urlencode.go @@ -0,0 +1,19 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +package utils + +import ( + "net/url" + "strings" +) + +func UrlEncode(str string) string { + strs := strings.Split(str, " ") + + for i, s := range strs { + strs[i] = url.QueryEscape(s) + } + + return strings.Join(strs, "%20") +} |