Browse Source

Fix: concurrent map read and map write

Copy custom headers to prevent concurrent map access which
results in a crash.
mirokuratczyk 2 years ago
parent
commit
ca24a733dd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      psiphon/net.go

+ 1 - 1
psiphon/net.go

@@ -537,7 +537,7 @@ func makeFrontedHTTPClient(
 		// UntunneledResolveIP.
 		meekDialConfig = &DialConfig{
 			UpstreamProxyURL: dialConfig.UpstreamProxyURL,
-			CustomHeaders:    dialConfig.CustomHeaders,
+			CustomHeaders:    makeDialCustomHeaders(config, p),
 			DeviceBinder:     dialConfig.DeviceBinder,
 			IPv6Synthesizer:  dialConfig.IPv6Synthesizer,
 			ResolveIP: func(ctx context.Context, hostname string) ([]net.IP, error) {