aboutsummaryrefslogtreecommitdiff
path: root/appservice/query/query.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-05-10 11:08:10 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-05-10 11:08:10 +0100
commit77722c5a4f5330f6fe517edc2d11bcba8c1fc274 (patch)
tree2c1da8cb54d9726e091a9e88b1386af2438322ee /appservice/query/query.go
parent1b3fa9689ca28de2337b67253089e286694c60e9 (diff)
Back out matrix-org/dendrite#2421 by restoring `http.Client`s
This creates problems with non-HTTPS endpoints and should fix #2444.
Diffstat (limited to 'appservice/query/query.go')
-rw-r--r--appservice/query/query.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/appservice/query/query.go b/appservice/query/query.go
index b7b0b335..dacd3caa 100644
--- a/appservice/query/query.go
+++ b/appservice/query/query.go
@@ -23,7 +23,6 @@ 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"
)
@@ -33,7 +32,7 @@ const userIDExistsPath = "/users/"
// AppServiceQueryAPI is an implementation of api.AppServiceQueryAPI
type AppServiceQueryAPI struct {
- HTTPClient *gomatrixserverlib.Client
+ HTTPClient *http.Client
Cfg *config.Dendrite
}
@@ -65,8 +64,9 @@ func (a *AppServiceQueryAPI) RoomAliasExists(
if err != nil {
return err
}
+ req = req.WithContext(ctx)
- resp, err := a.HTTPClient.DoHTTPRequest(ctx, req)
+ resp, err := a.HTTPClient.Do(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.DoHTTPRequest(ctx, req)
+ resp, err := a.HTTPClient.Do(req.WithContext(ctx))
if resp != nil {
defer func() {
err = resp.Body.Close()