mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
remove else
This commit is contained in:
parent
d55a9f6db3
commit
40d04c523e
|
|
@ -94,7 +94,16 @@ type ApplicationService struct {
|
|||
}
|
||||
|
||||
func (a *ApplicationService) CreateHTTPClient(insecureSkipVerify bool) {
|
||||
client := &http.Client{Timeout: time.Second * 30}
|
||||
client := &http.Client{
|
||||
Timeout: time.Second * 30,
|
||||
Transport: &http.Transport{
|
||||
DisableKeepAlives: true,
|
||||
TLSClientConfig: &tls.Config{
|
||||
InsecureSkipVerify: insecureSkipVerify,
|
||||
},
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
},
|
||||
}
|
||||
if strings.HasPrefix(a.URL, UnixSocketPrefix) {
|
||||
a.isUnixSocket = true
|
||||
a.unixSocket = "http://unix"
|
||||
|
|
@ -103,14 +112,6 @@ func (a *ApplicationService) CreateHTTPClient(insecureSkipVerify bool) {
|
|||
return net.Dial("unix", strings.TrimPrefix(a.URL, UnixSocketPrefix))
|
||||
},
|
||||
}
|
||||
} else {
|
||||
client.Transport = &http.Transport{
|
||||
DisableKeepAlives: true,
|
||||
TLSClientConfig: &tls.Config{
|
||||
InsecureSkipVerify: insecureSkipVerify,
|
||||
},
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
}
|
||||
}
|
||||
a.HTTPClient = client
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue