diff options
author | Corey Hulen <corey@hulen.com> | 2016-08-25 04:32:44 -0800 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-08-25 08:32:44 -0400 |
commit | 839f1ad444849db1dd18c9da0c3b7380b355a047 (patch) | |
tree | 5344f29c42a5db0af983402fa8bd47483992ead2 /api | |
parent | c3ae3f20f58b25aa6aba480ddc2239fd09e610cb (diff) | |
download | chat-839f1ad444849db1dd18c9da0c3b7380b355a047.tar.gz chat-839f1ad444849db1dd18c9da0c3b7380b355a047.tar.bz2 chat-839f1ad444849db1dd18c9da0c3b7380b355a047.zip |
Fixing license (#3878)
* Fixing sanitize license
* Fixing license
* Fixing unit tests
Diffstat (limited to 'api')
-rw-r--r-- | api/license.go | 10 | ||||
-rw-r--r-- | api/user.go | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/api/license.go b/api/license.go index f9ecce486..b7bf8a234 100644 --- a/api/license.go +++ b/api/license.go @@ -173,12 +173,18 @@ func RemoveLicense() *model.AppError { } func getClientLicenceConfig(c *Context, w http.ResponseWriter, r *http.Request) { - etag := utils.GetClientLicenseEtag() + etag := utils.GetClientLicenseEtag(!c.IsSystemAdmin()) if HandleEtag(etag, w, r) { return } - clientLicense := utils.ClientLicense + var clientLicense map[string]string + + if c.IsSystemAdmin() { + clientLicense = utils.ClientLicense + } else { + clientLicense = utils.GetSanitizedClientLicense() + } w.Header().Set(model.HEADER_ETAG_SERVER, etag) w.Write([]byte(model.MapToJson(clientLicense))) diff --git a/api/user.go b/api/user.go index d7eab3d46..b0d2c79b4 100644 --- a/api/user.go +++ b/api/user.go @@ -922,7 +922,7 @@ func getInitialLoad(c *Context, w http.ResponseWriter, r *http.Request) { if c.IsSystemAdmin() { il.LicenseCfg = utils.ClientLicense } else { - il.LicenseCfg = utils.GetSantizedClientLicense() + il.LicenseCfg = utils.GetSanitizedClientLicense() } w.Write([]byte(il.ToJson())) |