diff options
author | Hanzei <16541325+hanzei@users.noreply.github.com> | 2018-10-05 18:24:02 +0200 |
---|---|---|
committer | Jesse Hallam <jesse.hallam@gmail.com> | 2018-10-05 12:24:02 -0400 |
commit | 7b338c161bce8bdede54d85a5df5a0efe34eb874 (patch) | |
tree | c78040d86cef9d8fde6f35d1a2aee553a746c8be /app/config.go | |
parent | 0a68e741d07d086ca3a94c73a958cb9fa3c50943 (diff) | |
download | chat-7b338c161bce8bdede54d85a5df5a0efe34eb874.tar.gz chat-7b338c161bce8bdede54d85a5df5a0efe34eb874.tar.bz2 chat-7b338c161bce8bdede54d85a5df5a0efe34eb874.zip |
MM-12323: Fix trailing slash in ServiceSettings.SiteURL (#9463)
* Fix trailing slash in ServiceSettings.SiteURL
* Add test for LoadConfig
* Fix test
* Simplify test
Diffstat (limited to 'app/config.go')
-rw-r--r-- | app/config.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/config.go b/app/config.go index fde38c13e..cb74bd1b3 100644 --- a/app/config.go +++ b/app/config.go @@ -61,13 +61,12 @@ func (a *App) LoadConfig(configFile string) *model.AppError { if err != nil { return err } + *cfg.ServiceSettings.SiteURL = strings.TrimRight(*cfg.ServiceSettings.SiteURL, "/") + a.config.Store(cfg) a.configFile = configPath - - a.config.Store(cfg) a.envConfig = envConfig - - a.siteURL = strings.TrimRight(*cfg.ServiceSettings.SiteURL, "/") + a.siteURL = *cfg.ServiceSettings.SiteURL a.InvokeConfigListeners(old, cfg) return nil |