summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-10-08 09:59:08 -0400
committerChristopher Speller <crspeller@gmail.com>2015-10-08 09:59:08 -0400
commita6629f95fe958d2a308e62b5f662f9eca7aea0b2 (patch)
treea87a1d9f26df52a4e9254cabe078f76c609c6d92 /utils
parent7571d21f3200738199981c21b9466e0028d4fcbb (diff)
parentfea45ad0c570c32bd124abbf7256fae6e2a8bdf6 (diff)
downloadchat-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.go26
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
}