mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 08:55:28 +08:00 
			
		
		
		
	This commit is contained in:
		@@ -78,7 +78,7 @@ namespace Ocelot.Configuration.Builder
 | 
			
		||||
            return this;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public DownstreamReRouteBuilder WithUpstreamTemplatePattern(UpstreamPathTemplate input)
 | 
			
		||||
        public DownstreamReRouteBuilder WithUpstreamPathTemplate(UpstreamPathTemplate input)
 | 
			
		||||
        {
 | 
			
		||||
            _upstreamTemplatePattern = input;
 | 
			
		||||
            return this;
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
            return this;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public ReRouteBuilder WithUpstreamTemplatePattern(UpstreamPathTemplate input)
 | 
			
		||||
        public ReRouteBuilder WithUpstreamPathTemplate(UpstreamPathTemplate input)
 | 
			
		||||
        {
 | 
			
		||||
            _upstreamTemplatePattern = input;
 | 
			
		||||
            return this;
 | 
			
		||||
 
 | 
			
		||||
@@ -167,7 +167,7 @@ namespace Ocelot.Configuration.Creator
 | 
			
		||||
 | 
			
		||||
            var reRoute = new ReRouteBuilder()
 | 
			
		||||
                .WithUpstreamHttpMethod(aggregateReRoute.UpstreamHttpMethod)
 | 
			
		||||
                .WithUpstreamTemplatePattern(upstreamTemplatePattern)
 | 
			
		||||
                .WithUpstreamPathTemplate(upstreamTemplatePattern)
 | 
			
		||||
                .WithDownstreamReRoutes(applicableReRoutes)
 | 
			
		||||
                .WithUpstreamHost(aggregateReRoute.UpstreamHost)
 | 
			
		||||
                .WithAggregator(aggregateReRoute.Aggregator)
 | 
			
		||||
@@ -182,7 +182,7 @@ namespace Ocelot.Configuration.Creator
 | 
			
		||||
 | 
			
		||||
            var reRoute = new ReRouteBuilder()
 | 
			
		||||
                .WithUpstreamHttpMethod(fileReRoute.UpstreamHttpMethod)
 | 
			
		||||
                .WithUpstreamTemplatePattern(upstreamTemplatePattern)
 | 
			
		||||
                .WithUpstreamPathTemplate(upstreamTemplatePattern)
 | 
			
		||||
                .WithDownstreamReRoute(downstreamReRoutes)
 | 
			
		||||
                .WithUpstreamHost(fileReRoute.UpstreamHost)
 | 
			
		||||
                .Build();
 | 
			
		||||
@@ -228,7 +228,7 @@ namespace Ocelot.Configuration.Creator
 | 
			
		||||
                .WithKey(fileReRoute.Key)
 | 
			
		||||
                .WithDownstreamPathTemplate(fileReRoute.DownstreamPathTemplate)
 | 
			
		||||
                .WithUpstreamHttpMethod(fileReRoute.UpstreamHttpMethod)
 | 
			
		||||
                .WithUpstreamTemplatePattern(upstreamTemplatePattern)
 | 
			
		||||
                .WithUpstreamPathTemplate(upstreamTemplatePattern)
 | 
			
		||||
                .WithIsAuthenticated(fileReRouteOptions.IsAuthenticated)
 | 
			
		||||
                .WithAuthenticationOptions(authOptionsForRoute)
 | 
			
		||||
                .WithClaimsToHeaders(claimsToHeaders)
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,8 @@
 | 
			
		||||
 | 
			
		||||
            var qosOptions = _qoSOptionsCreator.Create(configuration.QoSOptions, downstreamPathForKeys, new []{ upstreamHttpMethod });
 | 
			
		||||
 | 
			
		||||
            var upstreamPathTemplate = new UpstreamPathTemplateBuilder().WithOriginalValue(upstreamUrlPath).Build();
 | 
			
		||||
 | 
			
		||||
            var downstreamReRouteBuilder = new DownstreamReRouteBuilder()
 | 
			
		||||
                .WithServiceName(serviceName)
 | 
			
		||||
                .WithLoadBalancerKey(loadBalancerKey)
 | 
			
		||||
@@ -52,7 +54,8 @@
 | 
			
		||||
                .WithHttpHandlerOptions(configuration.HttpHandlerOptions)
 | 
			
		||||
                .WithQosOptions(qosOptions)
 | 
			
		||||
                .WithDownstreamScheme(configuration.DownstreamScheme)
 | 
			
		||||
                .WithLoadBalancerOptions(configuration.LoadBalancerOptions);
 | 
			
		||||
                .WithLoadBalancerOptions(configuration.LoadBalancerOptions)
 | 
			
		||||
                .WithUpstreamPathTemplate(upstreamPathTemplate);
 | 
			
		||||
 | 
			
		||||
                var rateLimitOptions = configuration.ReRoutes != null 
 | 
			
		||||
                    ? configuration.ReRoutes
 | 
			
		||||
@@ -72,6 +75,7 @@
 | 
			
		||||
            var reRoute = new ReRouteBuilder()
 | 
			
		||||
                .WithDownstreamReRoute(downstreamReRoute)
 | 
			
		||||
                .WithUpstreamHttpMethod(new List<string>(){ upstreamHttpMethod })
 | 
			
		||||
                .WithUpstreamPathTemplate(upstreamPathTemplate)
 | 
			
		||||
                .Build();
 | 
			
		||||
 | 
			
		||||
            downstreamRoute = new OkResponse<DownstreamRoute>(new DownstreamRoute(new List<PlaceholderNameAndValue>(), reRoute));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user