mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 00:58:15 +08:00
Feature/fix admin api caching wrong re routes (#421)
* #383 added failing test for this issue * #383 identified issue was with cached load balancer for a given upstream path template based on the key we use, have modified this to include more data, I guess this might be an issue again for other things so I will have a think about it * #383 fixed failing tests after key change * Seems to be an issue with coveralls new package not being on nuget...try same version as their nuget package * bash the old manual tests json back in
This commit is contained in:
@ -199,7 +199,7 @@
|
||||
.WithDownstreamScheme("http")
|
||||
.WithUpstreamHttpMethod(new List<string>() {"Get"})
|
||||
.WithDownstreamAddresses(new List<DownstreamHostAndPort>() {new DownstreamHostAndPort("localhost", 51878)})
|
||||
.WithLoadBalancerKey("/laura|Get")
|
||||
.WithLoadBalancerKey("/laura|Get|localhost:51878")
|
||||
.Build();
|
||||
|
||||
var lauraReRoute = new ReRouteBuilder()
|
||||
@ -218,7 +218,7 @@
|
||||
.WithDownstreamScheme("http")
|
||||
.WithUpstreamHttpMethod(new List<string>() { "Get" })
|
||||
.WithDownstreamAddresses(new List<DownstreamHostAndPort>() { new DownstreamHostAndPort("localhost", 51878) })
|
||||
.WithLoadBalancerKey("/tom|Get")
|
||||
.WithLoadBalancerKey("/tom|Get|localhost:51880")
|
||||
.Build();
|
||||
|
||||
var tomReRoute = new ReRouteBuilder()
|
||||
@ -409,7 +409,7 @@
|
||||
.WithDownstreamPathTemplate("/products/{productId}")
|
||||
.WithUpstreamPathTemplate("/api/products/{productId}")
|
||||
.WithUpstreamHttpMethod(new List<string> {"Get"})
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|127.0.0.1:0")
|
||||
.Build();
|
||||
|
||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||
@ -461,7 +461,7 @@
|
||||
.WithUpstreamPathTemplate("/api/products/{productId}")
|
||||
.WithUpstreamHttpMethod(new List<string> {"Get"})
|
||||
.WithDelegatingHandlers(handlers)
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|")
|
||||
.Build();
|
||||
|
||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||
@ -506,7 +506,7 @@
|
||||
.WithUpstreamHttpMethod(new List<string> {"Get"})
|
||||
.WithUseServiceDiscovery(true)
|
||||
.WithServiceName("ProductService")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|")
|
||||
.Build();
|
||||
|
||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||
@ -557,7 +557,7 @@
|
||||
.WithUpstreamPathTemplate("/api/products/{productId}")
|
||||
.WithUpstreamHttpMethod(new List<string> {"Get"})
|
||||
.WithUseServiceDiscovery(false)
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|")
|
||||
.Build();
|
||||
|
||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||
@ -600,7 +600,7 @@
|
||||
.WithUpstreamPathTemplate("/api/products/{productId}")
|
||||
.WithUpstreamHttpMethod(new List<string> {"Get"})
|
||||
.WithUpstreamTemplatePattern(new UpstreamPathTemplate("(?i)/api/products/.*/$", 1))
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|")
|
||||
.Build();
|
||||
|
||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||
@ -645,7 +645,7 @@
|
||||
.WithUpstreamPathTemplate("/api/products/{productId}")
|
||||
.WithUpstreamHttpMethod(new List<string> {"Get"})
|
||||
.WithRequestIdKey("blahhhh")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|")
|
||||
.Build();
|
||||
|
||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||
@ -740,7 +740,7 @@
|
||||
{
|
||||
new ClaimToThing("CustomerId", "CustomerId", "", 0),
|
||||
})
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|")
|
||||
.Build();
|
||||
|
||||
var expected = new List<ReRoute>
|
||||
@ -783,7 +783,7 @@
|
||||
.WithUpstreamPathTemplate("/api/products/{productId}")
|
||||
.WithUpstreamHttpMethod(new List<string> {"Get"})
|
||||
.WithAuthenticationOptions(authenticationOptions)
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get")
|
||||
.WithLoadBalancerKey("/api/products/{productId}|Get|")
|
||||
.Build();
|
||||
|
||||
var expected = new List<ReRoute>
|
||||
|
Reference in New Issue
Block a user