diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-10-08 09:59:08 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-10-08 09:59:08 -0400 |
commit | a6629f95fe958d2a308e62b5f662f9eca7aea0b2 (patch) | |
tree | a87a1d9f26df52a4e9254cabe078f76c609c6d92 /utils | |
parent | 7571d21f3200738199981c21b9466e0028d4fcbb (diff) | |
parent | fea45ad0c570c32bd124abbf7256fae6e2a8bdf6 (diff) | |
download | chat-a6629f95fe958d2a308e62b5f662f9eca7aea0b2.tar.gz chat-a6629f95fe958d2a308e62b5f662f9eca7aea0b2.tar.bz2 chat-a6629f95fe958d2a308e62b5f662f9eca7aea0b2.zip |
Merge pull request #944 from mattermost/PLT-518
PLT-518 check for security bulletins
Diffstat (limited to 'utils')
-rw-r--r-- | utils/diagnostic.go | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/utils/diagnostic.go b/utils/diagnostic.go index 9a61ae934..e40948f62 100644 --- a/utils/diagnostic.go +++ b/utils/diagnostic.go @@ -5,41 +5,31 @@ package utils import ( "net/http" - - l4g "code.google.com/p/log4go" + "net/url" "github.com/mattermost/platform/model" ) const ( + DIAGNOSTIC_URL = "https://d7zmvsa9e04kk.cloudfront.net" + PROP_DIAGNOSTIC_ID = "id" PROP_DIAGNOSTIC_CATEGORY = "c" - VAL_DIAGNOSTIC_CATEGORY_DEFALUT = "d" + VAL_DIAGNOSTIC_CATEGORY_DEFAULT = "d" PROP_DIAGNOSTIC_BUILD = "b" PROP_DIAGNOSTIC_DATABASE = "db" PROP_DIAGNOSTIC_OS = "os" PROP_DIAGNOSTIC_USER_COUNT = "uc" ) -func SendDiagnostic(data model.StringMap) *model.AppError { - if Cfg.PrivacySettings.EnableDiagnostic && !model.IsOfficalBuild() { - - query := "?" - for name, value := range data { - if len(query) > 1 { - query += "&" - } +func SendDiagnostic(values url.Values) { + if Cfg.PrivacySettings.EnableSecurityFixAlert && model.IsOfficalBuild() { - query += name + "=" + UrlEncode(value) - } - - res, err := http.Get("http://d7zmvsa9e04kk.cloudfront.net/i" + query) + res, err := http.Get(DIAGNOSTIC_URL + "/i?" + values.Encode()) if err != nil { - l4g.Error("Failed to send diagnostics %v", err.Error()) + return } res.Body.Close() } - - return nil } |