summaryrefslogtreecommitdiffstats
path: root/app/oauth.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2018-09-07 09:24:18 -0400
committerGitHub <noreply@github.com>2018-09-07 09:24:18 -0400
commit0027d998555d47f9a75a896d8c6c85a8b4645ad0 (patch)
tree4a15d63c143e9891921d75f102dd008852c9abb2 /app/oauth.go
parent291000703320cc53c3bdecd2553fa4a3021d7234 (diff)
downloadchat-0027d998555d47f9a75a896d8c6c85a8b4645ad0.tar.gz
chat-0027d998555d47f9a75a896d8c6c85a8b4645ad0.tar.bz2
chat-0027d998555d47f9a75a896d8c6c85a8b4645ad0.zip
MM-11855 Add App.HTTPService to allow mocking of HTTP client (#9359)
* MM-11855 Add App.HTTPService to allow mocking of HTTP client * Initialize HTTPService earlier
Diffstat (limited to 'app/oauth.go')
-rw-r--r--app/oauth.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/oauth.go b/app/oauth.go
index a0123c0e9..645d502f5 100644
--- a/app/oauth.go
+++ b/app/oauth.go
@@ -761,7 +761,7 @@ func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service
var ar *model.AccessResponse
var bodyBytes []byte
- if resp, err := a.HTTPClient(true).Do(req); err != nil {
+ if resp, err := a.HTTPService.MakeClient(true).Do(req); err != nil {
return nil, "", stateProps, model.NewAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.token_failed.app_error", nil, err.Error(), http.StatusInternalServerError)
} else {
bodyBytes, _ = ioutil.ReadAll(resp.Body)
@@ -791,7 +791,7 @@ func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+ar.AccessToken)
- if resp, err := a.HTTPClient(true).Do(req); err != nil {
+ if resp, err := a.HTTPService.MakeClient(true).Do(req); err != nil {
return nil, "", stateProps, model.NewAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.service.app_error", map[string]interface{}{"Service": service}, err.Error(), http.StatusInternalServerError)
} else {
bodyBytes, _ = ioutil.ReadAll(resp.Body)