Update HTTP clients (#1457)

* Update gomatrixserverlib

* Use separate HTTP client for API calls, set User-Agent for outbound HTTP requests
This commit is contained in:
Neil Alexander 2020-10-01 11:55:17 +01:00 committed by GitHub
parent 91fc1f1c92
commit b1d5360335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 26 deletions

View file

@ -17,7 +17,6 @@ package main
import (
"github.com/matrix-org/dendrite/internal/setup"
"github.com/matrix-org/dendrite/mediaapi"
"github.com/matrix-org/gomatrixserverlib"
)
func main() {
@ -26,7 +25,7 @@ func main() {
defer base.Close() // nolint: errcheck
userAPI := base.UserAPIClient()
client := gomatrixserverlib.NewClient(cfg.FederationSender.DisableTLSValidation)
client := base.CreateClient()
mediaapi.AddPublicRoutes(base.PublicMediaAPIMux, &base.Cfg.MediaAPI, userAPI, client)

View file

@ -29,7 +29,6 @@ import (
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/serverkeyapi"
"github.com/matrix-org/dendrite/userapi"
"github.com/matrix-org/gomatrixserverlib"
)
var (
@ -125,7 +124,7 @@ func main() {
monolith := setup.Monolith{
Config: base.Cfg,
AccountDB: accountDB,
Client: gomatrixserverlib.NewClient(cfg.FederationSender.DisableTLSValidation),
Client: base.CreateClient(),
FedClient: federation,
KeyRing: keyRing,
KafkaConsumer: base.KafkaConsumer,