Browse Source

Fix: pre-allocated array was too long and always
contained empty strings.

Rod Hynes 9 years ago
parent
commit
cc9cdb19ac
1 changed files with 1 additions and 1 deletions
  1. 1 1
      psiphon/tunnel.go

+ 1 - 1
psiphon/tunnel.go

@@ -697,7 +697,7 @@ func dialSsh(
 				dialStats.UpstreamProxyType = proxyURL.Scheme
 				dialStats.UpstreamProxyType = proxyURL.Scheme
 			}
 			}
 
 
-			dialStats.UpstreamProxyCustomHeaderNames = make([]string, len(dialConfig.UpstreamProxyCustomHeaders))
+			dialStats.UpstreamProxyCustomHeaderNames = make([]string, 0)
 			for name, _ := range dialConfig.UpstreamProxyCustomHeaders {
 			for name, _ := range dialConfig.UpstreamProxyCustomHeaders {
 				dialStats.UpstreamProxyCustomHeaderNames = append(dialStats.UpstreamProxyCustomHeaderNames, name)
 				dialStats.UpstreamProxyCustomHeaderNames = append(dialStats.UpstreamProxyCustomHeaderNames, name)
 			}
 			}