summaryrefslogtreecommitdiffstats
path: root/app/post.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-11-22 09:15:03 -0600
committerHarrison Healey <harrisonmhealey@gmail.com>2017-11-22 10:15:03 -0500
commit77a1dc1f2f12198881c00356a04dddef126b985d (patch)
tree09b5510bb744d0d9e5056783dc7522c5641ec788 /app/post.go
parentcf9cd6a4b6bea717884269879ee8a3ced475ee8a (diff)
downloadchat-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.go6
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)
}