mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 15:50:49 +08:00 
			
		
		
		
	Web Sockets: work around .NET FX bug (#702)
This commit is contained in:
		
				
					committed by
					
						
						Tom Pallister
					
				
			
			
				
	
			
			
			
						parent
						
							14cff23d48
						
					
				
				
					commit
					fa5892d236
				
			@@ -90,7 +90,16 @@ namespace Ocelot.WebSockets.Middleware
 | 
			
		||||
            {
 | 
			
		||||
                if (!NotForwardedWebSocketHeaders.Contains(headerEntry.Key, StringComparer.OrdinalIgnoreCase))
 | 
			
		||||
                {
 | 
			
		||||
                    client.Options.SetRequestHeader(headerEntry.Key, headerEntry.Value);
 | 
			
		||||
                    try
 | 
			
		||||
                    {
 | 
			
		||||
                        client.Options.SetRequestHeader(headerEntry.Key, headerEntry.Value);
 | 
			
		||||
                    }
 | 
			
		||||
                    catch (ArgumentException)
 | 
			
		||||
                    {
 | 
			
		||||
                        // Expected in .NET Framework for headers that are mistakenly considered restricted.
 | 
			
		||||
                        // See: https://github.com/dotnet/corefx/issues/26627
 | 
			
		||||
                        // .NET Core does not exhibit this issue, ironically due to a separate bug (https://github.com/dotnet/corefx/issues/18784)
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user