mirror of https://github.com/v2ray/v2ray-core
				
				
				
			Prevent UA from being set to golang's default ones
Go automatically sets HTTP header `User-Agent' to `Go-http-client/1.1' if it hasn't been set before, which in some cases breaks the transparency of proxy. Such behavior can be prevented by setting it to an empty string.pull/685/head
							parent
							
								
									e60de73c70
								
							
						
					
					
						commit
						973378d610
					
				|  | @ -212,6 +212,11 @@ func StripHopByHopHeaders(header http.Header) { | ||||||
| 	for _, h := range strings.Split(connections, ",") { | 	for _, h := range strings.Split(connections, ",") { | ||||||
| 		header.Del(strings.TrimSpace(h)) | 		header.Del(strings.TrimSpace(h)) | ||||||
| 	} | 	} | ||||||
|  | 
 | ||||||
|  | 	// Prevent UA from being set to golang's default ones
 | ||||||
|  | 	if len(header.Get("User-Agent")) == 0 { | ||||||
|  | 		header.Set("User-Agent", "") | ||||||
|  | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| var errWaitAnother = newError("keep alive") | var errWaitAnother = newError("keep alive") | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Valture
						Valture