From ada84835eec1d69a962769afb590088d2f5a7d0a Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 16 Jul 2015 08:54:09 -0400 Subject: initial implementation of local server storage for files --- utils/config.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'utils') 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 { -- cgit v1.2.3-1-g7c22 From c63fbd4ccc5e7a11c4ce15fe7d19a3daf4e5c45e Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 17 Jul 2015 15:55:06 -0400 Subject: add proper url encoding for filenames --- utils/urlencode.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 utils/urlencode.go (limited to 'utils') 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") +} -- cgit v1.2.3-1-g7c22