From 6d8140337ef0f68f5177988f3c87bba5e4946399 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 18 Jun 2018 12:39:22 -0400 Subject: 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 --- api4/system.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'api4/system.go') 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) { -- cgit v1.2.3-1-g7c22