mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 15:30:49 +08:00 
			
		
		
		
	protect code against value not in accurate range
add unit test
This commit is contained in:
		@@ -18,8 +18,11 @@
 | 
			
		||||
        {
 | 
			
		||||
            var useTracing = _tracer != null && options.UseTracing;
 | 
			
		||||
 | 
			
		||||
            //be sure that maxConnectionPerServer is in correct range of values
 | 
			
		||||
            int maxConnectionPerServer = (options.MaxConnectionsPerServer > 0) ? maxConnectionPerServer = options.MaxConnectionsPerServer : maxConnectionPerServer = int.MaxValue;
 | 
			
		||||
 | 
			
		||||
            return new HttpHandlerOptions(options.AllowAutoRedirect,
 | 
			
		||||
                options.UseCookieContainer, useTracing, options.UseProxy, options.MaxConnectionsPerServer);
 | 
			
		||||
                options.UseCookieContainer, useTracing, options.UseProxy, maxConnectionPerServer);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user