diff options
author | Chris <ccbrown112@gmail.com> | 2017-11-22 09:15:03 -0600 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-11-22 10:15:03 -0500 |
commit | 77a1dc1f2f12198881c00356a04dddef126b985d (patch) | |
tree | 09b5510bb744d0d9e5056783dc7522c5641ec788 /app/post.go | |
parent | cf9cd6a4b6bea717884269879ee8a3ced475ee8a (diff) | |
download | chat-77a1dc1f2f12198881c00356a04dddef126b985d.tar.gz chat-77a1dc1f2f12198881c00356a04dddef126b985d.tar.bz2 chat-77a1dc1f2f12198881c00356a04dddef126b985d.zip |
HTTP client refactor (#7884)
* http client refactor
* simplification
Diffstat (limited to 'app/post.go')
-rw-r--r-- | app/post.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/post.go b/app/post.go index 1bada0095..00944ee3b 100644 --- a/app/post.go +++ b/app/post.go @@ -681,10 +681,10 @@ func (a *App) GetFileInfosForPost(postId string, readFromMaster bool) ([]*model. return infos, nil } -func GetOpenGraphMetadata(url string) *opengraph.OpenGraph { +func (a *App) GetOpenGraphMetadata(url string) *opengraph.OpenGraph { og := opengraph.NewOpenGraph() - res, err := utils.HttpClient(false).Get(url) + res, err := a.HTTPClient(false).Get(url) if err != nil { l4g.Error("GetOpenGraphMetadata request failed for url=%v with err=%v", url, err.Error()) return og @@ -721,7 +721,7 @@ func (a *App) DoPostAction(postId string, actionId string, userId string) *model req, _ := http.NewRequest("POST", action.Integration.URL, strings.NewReader(request.ToJson())) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept", "application/json") - resp, err := utils.HttpClient(false).Do(req) + resp, err := a.HTTPClient(false).Do(req) if err != nil { return model.NewAppError("DoPostAction", "api.post.do_action.action_integration.app_error", nil, "err="+err.Error(), http.StatusBadRequest) } |