Fix extended coverage main pipeline bug (#510)

This commit is contained in:
aqa510415008 2018-07-30 14:07:12 +08:00 committed by Tom Pallister
parent b0a20d13b9
commit 8711b07de6
2 changed files with 10 additions and 10 deletions

View File

@ -172,7 +172,7 @@ namespace Ocelot.Middleware.Pipeline
throw new ArgumentNullException(nameof(pipelineBuilderFunc)); throw new ArgumentNullException(nameof(pipelineBuilderFunc));
} }
var branchBuilder = app.New(); var branchBuilder = app.New();
var predicate = pipelineBuilderFunc.Invoke(app); var predicate = pipelineBuilderFunc.Invoke(branchBuilder);
var branch = branchBuilder.Build(); var branch = branchBuilder.Build();
var options = new MapWhenOptions var options = new MapWhenOptions

View File

@ -28,15 +28,6 @@ namespace Ocelot.Middleware.Pipeline
// It also sets the Request Id if anything is set globally // It also sets the Request Id if anything is set globally
builder.UseExceptionHandlerMiddleware(); builder.UseExceptionHandlerMiddleware();
//Expand other branch pipes
if (pipelineConfiguration.MapWhenOcelotPipeline != null)
{
foreach (var pipeline in pipelineConfiguration.MapWhenOcelotPipeline)
{
builder.MapWhen(pipeline);
}
}
// If the request is for websockets upgrade we fork into a different pipeline // If the request is for websockets upgrade we fork into a different pipeline
builder.MapWhen(context => context.HttpContext.WebSockets.IsWebSocketRequest, builder.MapWhen(context => context.HttpContext.WebSockets.IsWebSocketRequest,
app => app =>
@ -57,6 +48,15 @@ namespace Ocelot.Middleware.Pipeline
// Then we get the downstream route information // Then we get the downstream route information
builder.UseDownstreamRouteFinderMiddleware(); builder.UseDownstreamRouteFinderMiddleware();
//Expand other branch pipes
if (pipelineConfiguration.MapWhenOcelotPipeline != null)
{
foreach (var pipeline in pipelineConfiguration.MapWhenOcelotPipeline)
{
builder.MapWhen(pipeline);
}
}
// Now we have the ds route we can transform headers and stuff? // Now we have the ds route we can transform headers and stuff?
builder.UseHttpHeadersTransformationMiddleware(); builder.UseHttpHeadersTransformationMiddleware();