summaryrefslogtreecommitdiffstats
path: root/api4/system.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2018-06-18 12:39:22 -0400
committerGitHub <noreply@github.com>2018-06-18 12:39:22 -0400
commit6d8140337ef0f68f5177988f3c87bba5e4946399 (patch)
tree44dbe951f53f6de8cc9fceac2f51ca7a175a55bf /api4/system.go
parentf48d31c7a4c0332bfd10b986eee50611ab987e7c (diff)
downloadchat-6d8140337ef0f68f5177988f3c87bba5e4946399.tar.gz
chat-6d8140337ef0f68f5177988f3c87bba5e4946399.tar.bz2
chat-6d8140337ef0f68f5177988f3c87bba5e4946399.zip
MM-8701 Limit the number of client config fields sent before user logs in (#8954)
* MM-8701 Limit the number of client config fields sent before user logs in * Fixed missing client config field * Reduced duplication between limited and regular client config
Diffstat (limited to 'api4/system.go')
-rw-r--r--api4/system.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/api4/system.go b/api4/system.go
index acb02bc3e..68f998d6d 100644
--- a/api4/system.go
+++ b/api4/system.go
@@ -250,7 +250,14 @@ func getClientConfig(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- w.Write([]byte(model.MapToJson(c.App.ClientConfigWithComputed())))
+ var config map[string]string
+ if *c.App.Config().ServiceSettings.ExperimentalLimitClientConfig && len(c.Session.UserId) == 0 {
+ config = c.App.LimitedClientConfigWithComputed()
+ } else {
+ config = c.App.ClientConfigWithComputed()
+ }
+
+ w.Write([]byte(model.MapToJson(config)))
}
func getEnvironmentConfig(c *Context, w http.ResponseWriter, r *http.Request) {