From d9a7db0f19f7b694c429354d3f2e7414c1462105 Mon Sep 17 00:00:00 2001 From: Koki Tomoshige <36136133+tomocy@users.noreply.github.com> Date: Sat, 12 Jan 2019 07:38:34 +0900 Subject: [PATCH] Fix typo: (*App).CheckForClienSideCert to (*App).CheckForClientSideCert (#10092) N/A - [x] Includes text changes and localization file ([.../i18n/en.json](https://github.com/mattermost/platform/blob/master/i18n/en.json) and [.../webapp/i18n/en.json](https://github.com/mattermost/platform/tree/master/webapp/i18n/en.json)) updates --- api4/user.go | 2 +- app/login.go | 2 +- app/login_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api4/user.go b/api4/user.go index a146c00c00..395a8018b1 100644 --- a/api4/user.go +++ b/api4/user.go @@ -1094,7 +1094,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = model.NewAppError("ClientSideCertNotAllowed", "api.user.login.client_side_cert.license.app_error", nil, "", http.StatusBadRequest) return } - certPem, certSubject, certEmail := c.App.CheckForClienSideCert(r) + certPem, certSubject, certEmail := c.App.CheckForClientSideCert(r) mlog.Debug("Client Cert", mlog.String("cert_subject", certSubject), mlog.String("cert_email", certEmail)) if len(certPem) == 0 || len(certEmail) == 0 { diff --git a/app/login.go b/app/login.go index a12437190a..b7bd07fd13 100644 --- a/app/login.go +++ b/app/login.go @@ -15,7 +15,7 @@ import ( "github.com/mattermost/mattermost-server/store" ) -func (a *App) CheckForClienSideCert(r *http.Request) (string, string, string) { +func (a *App) CheckForClientSideCert(r *http.Request) (string, string, string) { pem := r.Header.Get("X-SSL-Client-Cert") // mapped to $ssl_client_cert from nginx subject := r.Header.Get("X-SSL-Client-Cert-Subject-DN") // mapped to $ssl_client_s_dn from nginx email := "" diff --git a/app/login_test.go b/app/login_test.go index db92f1d7d7..b30b548d80 100644 --- a/app/login_test.go +++ b/app/login_test.go @@ -8,7 +8,7 @@ import ( "testing" ) -func TestCheckForClienSideCert(t *testing.T) { +func TestCheckForClientSideCert(t *testing.T) { th := Setup() defer th.TearDown() @@ -28,10 +28,10 @@ func TestCheckForClienSideCert(t *testing.T) { r.Header.Add("X-SSL-Client-Cert", tt.pem) r.Header.Add("X-SSL-Client-Cert-Subject-DN", tt.subject) - _, _, actualEmail := th.App.CheckForClienSideCert(r) + _, _, actualEmail := th.App.CheckForClientSideCert(r) if actualEmail != tt.expectedEmail { - t.Fatalf("CheckForClienSideCert(%v): expected %v, actual %v", tt.subject, tt.expectedEmail, actualEmail) + t.Fatalf("CheckForClientSideCert(%v): expected %v, actual %v", tt.subject, tt.expectedEmail, actualEmail) } } }