diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-05-05 11:33:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 11:33:16 +0100 |
commit | d9e71b93b68efb57582d02448883b8a1259205e8 (patch) | |
tree | ec9e43445e09cc10908a8ef50223310ec1cac627 /appservice/query | |
parent | 1bfe87aa5614d68cbb0cad127b375048cdc70ca9 (diff) |
Use `gomatrixserverlib.Client` instead of `http.Client` (#2421)
* Update to matrix-org/gomatrixserverlib#303
* Use `gomatrixserverlib.Client` for phone-home stats
* Use `gomatrixserverlib.Client` for push notifications
* Use `gomatrixserverlib.Client` for appservices
* Use `gomatrixserverlib.Client` for three-PID invites
Diffstat (limited to 'appservice/query')
-rw-r--r-- | appservice/query/query.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/appservice/query/query.go b/appservice/query/query.go index dacd3caa..b7b0b335 100644 --- a/appservice/query/query.go +++ b/appservice/query/query.go @@ -23,6 +23,7 @@ import ( "github.com/matrix-org/dendrite/appservice/api" "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/gomatrixserverlib" opentracing "github.com/opentracing/opentracing-go" log "github.com/sirupsen/logrus" ) @@ -32,7 +33,7 @@ const userIDExistsPath = "/users/" // AppServiceQueryAPI is an implementation of api.AppServiceQueryAPI type AppServiceQueryAPI struct { - HTTPClient *http.Client + HTTPClient *gomatrixserverlib.Client Cfg *config.Dendrite } @@ -64,9 +65,8 @@ func (a *AppServiceQueryAPI) RoomAliasExists( if err != nil { return err } - req = req.WithContext(ctx) - resp, err := a.HTTPClient.Do(req) + resp, err := a.HTTPClient.DoHTTPRequest(ctx, req) if resp != nil { defer func() { err = resp.Body.Close() @@ -130,7 +130,7 @@ func (a *AppServiceQueryAPI) UserIDExists( if err != nil { return err } - resp, err := a.HTTPClient.Do(req.WithContext(ctx)) + resp, err := a.HTTPClient.DoHTTPRequest(ctx, req) if resp != nil { defer func() { err = resp.Body.Close() |