lib/proxy: there is no need in cloning tlsCfg, which has been created two lines above

This commit is contained in:
Aliaksandr Valialkin 2021-03-12 10:46:45 +02:00
parent 895d5d1355
commit ca4d5ce037

View file

@ -97,7 +97,6 @@ func (u *URL) NewDialFunc(ac *promauth.Config) (fasthttp.DialFunc, error) {
if isTLS { if isTLS {
tlsCfg = ac.NewTLSConfig() tlsCfg = ac.NewTLSConfig()
if !tlsCfg.InsecureSkipVerify && tlsCfg.ServerName == "" { if !tlsCfg.InsecureSkipVerify && tlsCfg.ServerName == "" {
tlsCfg = tlsCfg.Clone()
tlsCfg.ServerName = tlsServerName(proxyAddr) tlsCfg.ServerName = tlsServerName(proxyAddr)
} }
} }