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
Этот коммит содержится в:
Harrison Healey
2018-06-18 12:39:22 -04:00
коммит произвёл GitHub
родитель f48d31c7a4
Коммит 6d8140337e
8 изменённых файлов: 246 добавлений и 106 удалений

Просмотреть файл

@@ -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) {