From 591ef9f352efd98a85e6d04c0c9072c4c2987527 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 5 Jan 2018 16:17:57 -0600 Subject: Remove utils.ClientCfg and utils.ClientCfgHash (#8041) * remove utils.ClientCfg and utils.ClientCfgHash * remove unused import --- api/context.go | 2 +- api/general.go | 3 +-- api/user.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'api') diff --git a/api/context.go b/api/context.go index 2842e63a7..4f47271e2 100644 --- a/api/context.go +++ b/api/context.go @@ -151,7 +151,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { c.SetSiteURLHeader(app.GetProtocol(r) + "://" + r.Host) w.Header().Set(model.HEADER_REQUEST_ID, c.RequestId) - w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.ClientCfgHash, utils.IsLicensed())) + w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, c.App.ClientConfigHash(), utils.IsLicensed())) // Instruct the browser not to display us in an iframe unless is the same origin for anti-clickjacking if !h.isApi { diff --git a/api/general.go b/api/general.go index 0fd289ffb..94da47330 100644 --- a/api/general.go +++ b/api/general.go @@ -9,7 +9,6 @@ import ( "strings" "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" ) func (api *API) InitGeneral() { @@ -19,7 +18,7 @@ func (api *API) InitGeneral() { } func getClientConfig(c *Context, w http.ResponseWriter, r *http.Request) { - w.Write([]byte(model.MapToJson(utils.ClientCfg))) + w.Write([]byte(model.MapToJson(c.App.ClientConfig()))) } func logClient(c *Context, w http.ResponseWriter, r *http.Request) { diff --git a/api/user.go b/api/user.go index f9b0af469..55042498a 100644 --- a/api/user.go +++ b/api/user.go @@ -297,7 +297,7 @@ func getInitialLoad(c *Context, w http.ResponseWriter, r *http.Request) { il.NoAccounts = c.App.IsFirstUserAccount() } - il.ClientCfg = utils.ClientCfg + il.ClientCfg = c.App.ClientConfig() if c.App.SessionHasPermissionTo(c.Session, model.PERMISSION_MANAGE_SYSTEM) { il.LicenseCfg = utils.ClientLicense() } else { -- cgit v1.2.3-1-g7c22