From 87343176fcc01eb064def97a913157e3967ffcc6 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Wed, 5 Apr 2017 19:10:20 +0100 Subject: PLT-5977: Only reload clients when client config changes. (#5989) --- api/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api') diff --git a/api/context.go b/api/context.go index ff6018920..bc5855345 100644 --- a/api/context.go +++ b/api/context.go @@ -149,7 +149,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.CfgHash, utils.IsLicensed)) + w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.ClientCfgHash, utils.IsLicensed)) if einterfaces.GetClusterInterface() != nil { w.Header().Set(model.HEADER_CLUSTER_ID, einterfaces.GetClusterInterface().GetClusterId()) } -- cgit v1.2.3-1-g7c22 From 331024d33c0c84f7ce67ce8ccd3dd9af91afad52 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 10 Apr 2017 06:26:16 -0400 Subject: Use SiteURL for OAuth login (#6032) --- api/oauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api') diff --git a/api/oauth.go b/api/oauth.go index 4a71500c4..1e3dd89b8 100644 --- a/api/oauth.go +++ b/api/oauth.go @@ -702,7 +702,7 @@ func GetAuthorizationCode(c *Context, service string, props map[string]string, l props["hash"] = model.HashPassword(clientId) state := b64.StdEncoding.EncodeToString([]byte(model.MapToJson(props))) - redirectUri := c.GetSiteURLHeader() + "/signup/" + service + "/complete" + redirectUri := utils.GetSiteURL() + "/signup/" + service + "/complete" authUrl := endpoint + "?response_type=code&client_id=" + clientId + "&redirect_uri=" + url.QueryEscape(redirectUri) + "&state=" + url.QueryEscape(state) -- cgit v1.2.3-1-g7c22 From 5c89fe1b8d7ce4cf63f697609b18817ad1c626fe Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 10 Apr 2017 14:47:38 -0400 Subject: Fix configuration setting --- api/oauth_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'api') diff --git a/api/oauth_test.go b/api/oauth_test.go index 87a8f847c..5f55ae8f0 100644 --- a/api/oauth_test.go +++ b/api/oauth_test.go @@ -188,8 +188,8 @@ func TestOAuthGetAppsByUser(t *testing.T) { utils.Cfg.ServiceSettings.EnableOAuthServiceProvider = true - if _, err := Client.GetOAuthAppsByUser(); err != nil { - t.Fatal("Should have passed.") + if _, err := Client.GetOAuthAppsByUser(); err == nil { + t.Fatal("Should have failed.") } *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations = false -- cgit v1.2.3-1-g7c22 From c6ef33ba0164cb5ba1c3dbf5f05d83b39db0407d Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Fri, 7 Apr 2017 19:05:34 +0200 Subject: get the latest message from the mailbox. It fixes the issue PLT-6176 (#6005) --- api/post_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'api') diff --git a/api/post_test.go b/api/post_test.go index a72074547..d2297fb69 100644 --- a/api/post_test.go +++ b/api/post_test.go @@ -1053,10 +1053,10 @@ func TestEmailMention(t *testing.T) { t.Log("No email was received, maybe due load on the server. Disabling this verification") } if err == nil && len(resultsMailbox) > 0 { - if !strings.ContainsAny(resultsMailbox[0].To[0], th.BasicUser2.Email) { + if !strings.ContainsAny(resultsMailbox[len(resultsMailbox)-1].To[0], th.BasicUser2.Email) { t.Fatal("Wrong To recipient") } else { - if resultsEmail, err := utils.GetMessageFromMailbox(th.BasicUser2.Email, resultsMailbox[0].ID); err == nil { + if resultsEmail, err := utils.GetMessageFromMailbox(th.BasicUser2.Email, resultsMailbox[len(resultsMailbox)-1].ID); err == nil { if !strings.Contains(resultsEmail.Body.Text, post1.Message) { t.Log(resultsEmail.Body.Text) t.Fatal("Received wrong Message") -- cgit v1.2.3-1-g7c22