mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Leverage client options instead of exposing http client
This commit is contained in:
parent
d3e9ed1097
commit
881d831225
|
|
@ -85,6 +85,7 @@ func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) fc
|
||||||
fclient.WithTimeout(time.Minute * 5),
|
fclient.WithTimeout(time.Minute * 5),
|
||||||
fclient.WithSkipVerify(cfg.FederationAPI.DisableTLSValidation),
|
fclient.WithSkipVerify(cfg.FederationAPI.DisableTLSValidation),
|
||||||
fclient.WithKeepAlives(!cfg.FederationAPI.DisableHTTPKeepalives),
|
fclient.WithKeepAlives(!cfg.FederationAPI.DisableHTTPKeepalives),
|
||||||
|
fclient.WithUserAgent(fmt.Sprintf("Dendrite/%s", internal.VersionString())),
|
||||||
}
|
}
|
||||||
if cfg.Global.DNSCache.Enabled {
|
if cfg.Global.DNSCache.Enabled {
|
||||||
opts = append(opts, fclient.WithDNSCache(dnsCache))
|
opts = append(opts, fclient.WithDNSCache(dnsCache))
|
||||||
|
|
@ -92,7 +93,6 @@ func CreateFederationClient(cfg *config.Dendrite, dnsCache *fclient.DNSCache) fc
|
||||||
client := fclient.NewFederationClient(
|
client := fclient.NewFederationClient(
|
||||||
identities, opts...,
|
identities, opts...,
|
||||||
)
|
)
|
||||||
client.WithUserAgent(fmt.Sprintf("Dendrite/%s", internal.VersionString()))
|
|
||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,8 +147,8 @@ func newFedClient(tripper func(*http.Request) (*http.Response, error)) fclient.F
|
||||||
PrivateKey: pkey,
|
PrivateKey: pkey,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
fclient.WithTransport(&roundTripper{tripper}),
|
||||||
)
|
)
|
||||||
fedClient.SetInternalClient(*fclient.NewClient(fclient.WithTransport(&roundTripper{tripper})))
|
|
||||||
return fedClient
|
return fedClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue