mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 10:35:28 +08:00 
			
		
		
		
	* Add ability to specify whether to UseProxy or not on ReRoutes (#390) * Remove useProxy default value from HttpHandlerOptions constructor
This commit is contained in:
		
				
					committed by
					
						
						Tom Pallister
					
				
			
			
				
	
			
			
			
						parent
						
							0f2a9c1d0d
						
					
				
				
					commit
					87c13bd9b4
				
			@@ -15,10 +15,10 @@ namespace Ocelot.Configuration.Creator
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        public HttpHandlerOptions Create(FileHttpHandlerOptions options)
 | 
					        public HttpHandlerOptions Create(FileHttpHandlerOptions options)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var useTracing = _tracer.GetType() != typeof(FakeServiceTracer) && options.UseTracing;
 | 
					            var useTracing = _tracer.GetType() != typeof(FakeServiceTracer) && options.UseTracing;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return new HttpHandlerOptions(options.AllowAutoRedirect,
 | 
					            return new HttpHandlerOptions(options.AllowAutoRedirect,
 | 
				
			||||||
                options.UseCookieContainer, useTracing);
 | 
					                options.UseCookieContainer, useTracing, options.UseProxy);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,13 +5,16 @@
 | 
				
			|||||||
        public FileHttpHandlerOptions()
 | 
					        public FileHttpHandlerOptions()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            AllowAutoRedirect = false;
 | 
					            AllowAutoRedirect = false;
 | 
				
			||||||
            UseCookieContainer = false;
 | 
					            UseCookieContainer = false;
 | 
				
			||||||
 | 
					            UseProxy = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool AllowAutoRedirect { get; set; }
 | 
					        public bool AllowAutoRedirect { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool UseCookieContainer { get; set; }
 | 
					        public bool UseCookieContainer { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool UseTracing { get; set; }
 | 
					        public bool UseTracing { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool UseProxy { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,11 +6,12 @@
 | 
				
			|||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    public class HttpHandlerOptions
 | 
					    public class HttpHandlerOptions
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public HttpHandlerOptions(bool allowAutoRedirect, bool useCookieContainer, bool useTracing)
 | 
					        public HttpHandlerOptions(bool allowAutoRedirect, bool useCookieContainer, bool useTracing, bool useProxy)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            AllowAutoRedirect = allowAutoRedirect;
 | 
					            AllowAutoRedirect = allowAutoRedirect;
 | 
				
			||||||
            UseCookieContainer = useCookieContainer;
 | 
					            UseCookieContainer = useCookieContainer;
 | 
				
			||||||
            UseTracing = useTracing;
 | 
					            UseTracing = useTracing;
 | 
				
			||||||
 | 
					            UseProxy = useProxy;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
@@ -23,9 +24,14 @@
 | 
				
			|||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public bool UseCookieContainer { get; private set; }
 | 
					        public bool UseCookieContainer { get; private set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Specify is handler has to use a opentracing
 | 
					        /// Specify is handler has to use a opentracing
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public bool UseTracing { get; private set; }
 | 
					        public bool UseTracing { get; private set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// Specify if handler has to use a proxy
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public bool UseProxy { get; private set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@
 | 
				
			|||||||
        private bool _allowAutoRedirect;
 | 
					        private bool _allowAutoRedirect;
 | 
				
			||||||
        private bool _useCookieContainer;
 | 
					        private bool _useCookieContainer;
 | 
				
			||||||
        private bool _useTracing;
 | 
					        private bool _useTracing;
 | 
				
			||||||
 | 
					        private bool _useProxy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public HttpHandlerOptionsBuilder WithAllowAutoRedirect(bool input)
 | 
					        public HttpHandlerOptionsBuilder WithAllowAutoRedirect(bool input)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -24,9 +25,15 @@
 | 
				
			|||||||
            return this;
 | 
					            return this;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public HttpHandlerOptionsBuilder WithUseProxy(bool useProxy)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            _useProxy = useProxy;
 | 
				
			||||||
 | 
					            return this;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public HttpHandlerOptions Build()
 | 
					        public HttpHandlerOptions Build()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return new HttpHandlerOptions(_allowAutoRedirect, _useCookieContainer, _useTracing);
 | 
					            return new HttpHandlerOptions(_allowAutoRedirect, _useCookieContainer, _useTracing, _useProxy);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,6 +89,7 @@ namespace Ocelot.Requester
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                AllowAutoRedirect = context.DownstreamReRoute.HttpHandlerOptions.AllowAutoRedirect,
 | 
					                AllowAutoRedirect = context.DownstreamReRoute.HttpHandlerOptions.AllowAutoRedirect,
 | 
				
			||||||
                UseCookies = context.DownstreamReRoute.HttpHandlerOptions.UseCookieContainer,
 | 
					                UseCookies = context.DownstreamReRoute.HttpHandlerOptions.UseCookieContainer,
 | 
				
			||||||
 | 
					                UseProxy = context.DownstreamReRoute.HttpHandlerOptions.UseProxy
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -98,6 +99,7 @@ namespace Ocelot.Requester
 | 
				
			|||||||
                {
 | 
					                {
 | 
				
			||||||
                    AllowAutoRedirect = context.DownstreamReRoute.HttpHandlerOptions.AllowAutoRedirect,
 | 
					                    AllowAutoRedirect = context.DownstreamReRoute.HttpHandlerOptions.AllowAutoRedirect,
 | 
				
			||||||
                    UseCookies = context.DownstreamReRoute.HttpHandlerOptions.UseCookieContainer,
 | 
					                    UseCookies = context.DownstreamReRoute.HttpHandlerOptions.UseCookieContainer,
 | 
				
			||||||
 | 
					                    UseProxy = context.DownstreamReRoute.HttpHandlerOptions.UseProxy,
 | 
				
			||||||
                    CookieContainer = new CookieContainer()
 | 
					                    CookieContainer = new CookieContainer()
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -688,7 +688,7 @@
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            var reRouteOptions = new ReRouteOptionsBuilder()
 | 
					            var reRouteOptions = new ReRouteOptionsBuilder()
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
            var httpHandlerOptions = new HttpHandlerOptions(true, true,false);
 | 
					            var httpHandlerOptions = new HttpHandlerOptions(true, true,false, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => x.GivenTheConfigIs(new FileConfiguration
 | 
					            this.Given(x => x.GivenTheConfigIs(new FileConfiguration
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,7 +35,7 @@ namespace Ocelot.UnitTests.Configuration
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var expectedOptions = new HttpHandlerOptions(false, false, false);
 | 
					            var expectedOptions = new HttpHandlerOptions(false, false, false, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
					            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
				
			||||||
                .When(x => WhenICreateHttpHandlerOptions())
 | 
					                .When(x => WhenICreateHttpHandlerOptions())
 | 
				
			||||||
@@ -54,7 +54,7 @@ namespace Ocelot.UnitTests.Configuration
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var expectedOptions = new HttpHandlerOptions(false, false, true);
 | 
					            var expectedOptions = new HttpHandlerOptions(false, false, true, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
					            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
				
			||||||
                .And(x => GivenARealTracer())
 | 
					                .And(x => GivenARealTracer())
 | 
				
			||||||
@@ -67,7 +67,7 @@ namespace Ocelot.UnitTests.Configuration
 | 
				
			|||||||
        public void should_create_options_with_useCookie_false_and_allowAutoRedirect_true_as_default()
 | 
					        public void should_create_options_with_useCookie_false_and_allowAutoRedirect_true_as_default()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var fileReRoute = new FileReRoute();
 | 
					            var fileReRoute = new FileReRoute();
 | 
				
			||||||
            var expectedOptions = new HttpHandlerOptions(false, false, false);
 | 
					            var expectedOptions = new HttpHandlerOptions(false, false, false, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
					            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
				
			||||||
                .When(x => WhenICreateHttpHandlerOptions())
 | 
					                .When(x => WhenICreateHttpHandlerOptions())
 | 
				
			||||||
@@ -88,7 +88,42 @@ namespace Ocelot.UnitTests.Configuration
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var expectedOptions = new HttpHandlerOptions(false, false, false);
 | 
					            var expectedOptions = new HttpHandlerOptions(false, false, false, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
				
			||||||
 | 
					                .When(x => WhenICreateHttpHandlerOptions())
 | 
				
			||||||
 | 
					                .Then(x => ThenTheFollowingOptionsReturned(expectedOptions))
 | 
				
			||||||
 | 
					                .BDDfy();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Fact]
 | 
				
			||||||
 | 
					        public void should_create_options_with_useproxy_true_as_default()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var fileReRoute = new FileReRoute
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                HttpHandlerOptions = new FileHttpHandlerOptions()
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var expectedOptions = new HttpHandlerOptions(false, false, false, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
				
			||||||
 | 
					                .When(x => WhenICreateHttpHandlerOptions())
 | 
				
			||||||
 | 
					                .Then(x => ThenTheFollowingOptionsReturned(expectedOptions))
 | 
				
			||||||
 | 
					                .BDDfy();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Fact]
 | 
				
			||||||
 | 
					        public void should_create_options_with_specified_useproxy()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var fileReRoute = new FileReRoute
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                HttpHandlerOptions = new FileHttpHandlerOptions
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    UseProxy = false
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var expectedOptions = new HttpHandlerOptions(false, false, false, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
					            this.Given(x => GivenTheFollowing(fileReRoute))
 | 
				
			||||||
                .When(x => WhenICreateHttpHandlerOptions())
 | 
					                .When(x => WhenICreateHttpHandlerOptions())
 | 
				
			||||||
@@ -111,7 +146,8 @@ namespace Ocelot.UnitTests.Configuration
 | 
				
			|||||||
            _httpHandlerOptions.ShouldNotBeNull();
 | 
					            _httpHandlerOptions.ShouldNotBeNull();
 | 
				
			||||||
            _httpHandlerOptions.AllowAutoRedirect.ShouldBe(expected.AllowAutoRedirect);
 | 
					            _httpHandlerOptions.AllowAutoRedirect.ShouldBe(expected.AllowAutoRedirect);
 | 
				
			||||||
            _httpHandlerOptions.UseCookieContainer.ShouldBe(expected.UseCookieContainer);
 | 
					            _httpHandlerOptions.UseCookieContainer.ShouldBe(expected.UseCookieContainer);
 | 
				
			||||||
            _httpHandlerOptions.UseTracing.ShouldBe(expected.UseTracing);
 | 
					            _httpHandlerOptions.UseTracing.ShouldBe(expected.UseTracing);
 | 
				
			||||||
 | 
					            _httpHandlerOptions.UseProxy.ShouldBe(expected.UseProxy);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void GivenARealTracer()
 | 
					        private void GivenARealTracer()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true, true))
 | 
				
			||||||
                .WithDelegatingHandlers(new List<string>
 | 
					                .WithDelegatingHandlers(new List<string>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "FakeDelegatingHandler",
 | 
					                    "FakeDelegatingHandler",
 | 
				
			||||||
@@ -82,7 +82,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true, true))
 | 
				
			||||||
                .WithDelegatingHandlers(new List<string>
 | 
					                .WithDelegatingHandlers(new List<string>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "FakeDelegatingHandlerTwo",
 | 
					                    "FakeDelegatingHandlerTwo",
 | 
				
			||||||
@@ -119,7 +119,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true, true))
 | 
				
			||||||
                .WithDelegatingHandlers(new List<string>
 | 
					                .WithDelegatingHandlers(new List<string>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "FakeDelegatingHandlerTwo",
 | 
					                    "FakeDelegatingHandlerTwo",
 | 
				
			||||||
@@ -155,7 +155,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true, true))
 | 
				
			||||||
                .WithDelegatingHandlers(new List<string>
 | 
					                .WithDelegatingHandlers(new List<string>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "FakeDelegatingHandler",
 | 
					                    "FakeDelegatingHandler",
 | 
				
			||||||
@@ -189,7 +189,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, true, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -215,7 +215,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false, true))
 | 
				
			||||||
                .WithDelegatingHandlers(new List<string>
 | 
					                .WithDelegatingHandlers(new List<string>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "FakeDelegatingHandler",
 | 
					                    "FakeDelegatingHandler",
 | 
				
			||||||
@@ -244,7 +244,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false)).WithLoadBalancerKey("").Build();
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false, true)).WithLoadBalancerKey("").Build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
					            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
				
			||||||
                .And(x => GivenTheQosProviderHouseReturns(new OkResponse<IQoSProvider>(It.IsAny<PollyQoSProvider>())))
 | 
					                .And(x => GivenTheQosProviderHouseReturns(new OkResponse<IQoSProvider>(It.IsAny<PollyQoSProvider>())))
 | 
				
			||||||
@@ -264,7 +264,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false)).WithLoadBalancerKey("").Build();
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false, true)).WithLoadBalancerKey("").Build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
					            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
				
			||||||
                .And(x => GivenTheServiceProviderReturnsNothing())
 | 
					                .And(x => GivenTheServiceProviderReturnsNothing())
 | 
				
			||||||
@@ -284,7 +284,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false)).WithLoadBalancerKey("").Build();
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false, true)).WithLoadBalancerKey("").Build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
					            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
				
			||||||
                .And(x => GivenTheQosProviderHouseReturns(new OkResponse<IQoSProvider>(It.IsAny<PollyQoSProvider>())))
 | 
					                .And(x => GivenTheQosProviderHouseReturns(new OkResponse<IQoSProvider>(It.IsAny<PollyQoSProvider>())))
 | 
				
			||||||
@@ -306,7 +306,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false)).WithLoadBalancerKey("").Build();
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(true, true, false, true)).WithLoadBalancerKey("").Build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
					            this.Given(x => GivenTheFollowingRequest(reRoute))
 | 
				
			||||||
                .And(x => GivenTheQosProviderHouseReturns(new ErrorResponse<IQoSProvider>(It.IsAny<Error>())))
 | 
					                .And(x => GivenTheQosProviderHouseReturns(new ErrorResponse<IQoSProvider>(It.IsAny<Error>())))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,8 @@
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.IO;
 | 
					using System.IO;
 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
using System.Net;
 | 
					using System.Net;
 | 
				
			||||||
using System.Net.Http;
 | 
					using System.Net.Http;
 | 
				
			||||||
using System.Threading;
 | 
					 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
using Microsoft.AspNetCore.Builder;
 | 
					using Microsoft.AspNetCore.Builder;
 | 
				
			||||||
using Microsoft.AspNetCore.Hosting;
 | 
					using Microsoft.AspNetCore.Hosting;
 | 
				
			||||||
@@ -51,7 +49,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
@@ -71,7 +69,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
				
			||||||
                .WithDangerousAcceptAnyServerCertificateValidator(true)
 | 
					                .WithDangerousAcceptAnyServerCertificateValidator(true)
 | 
				
			||||||
@@ -93,7 +91,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
@@ -124,7 +122,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, true, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, true, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
@@ -159,7 +157,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,7 +52,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
@@ -78,7 +78,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().Build())
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
@@ -103,7 +103,7 @@ namespace Ocelot.UnitTests.Requester
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var reRoute = new DownstreamReRouteBuilder()
 | 
					            var reRoute = new DownstreamReRouteBuilder()
 | 
				
			||||||
                .WithQosOptions(qosOptions)
 | 
					                .WithQosOptions(qosOptions)
 | 
				
			||||||
                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false))
 | 
					                .WithHttpHandlerOptions(new HttpHandlerOptions(false, false, false, true))
 | 
				
			||||||
                .WithLoadBalancerKey("")
 | 
					                .WithLoadBalancerKey("")
 | 
				
			||||||
                .WithQosOptions(new QoSOptionsBuilder().WithTimeoutValue(1).Build())
 | 
					                .WithQosOptions(new QoSOptionsBuilder().WithTimeoutValue(1).Build())
 | 
				
			||||||
                .Build();
 | 
					                .Build();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user