diff options
Diffstat (limited to 'utils/diagnostic.go')
-rw-r--r-- | utils/diagnostic.go | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/utils/diagnostic.go b/utils/diagnostic.go index 9a61ae934..da02e771b 100644 --- a/utils/diagnostic.go +++ b/utils/diagnostic.go @@ -1,45 +1,35 @@ -// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. 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 } |