Skip to content

Commit

Permalink
Fix extended coverage main pipeline bug (ThreeMammals#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfzm authored and TomPallister committed Jul 30, 2018
1 parent b0a20d1 commit 8711b07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static IOcelotPipelineBuilder MapWhen(this IOcelotPipelineBuilder app, Fu
throw new ArgumentNullException(nameof(pipelineBuilderFunc));
}
var branchBuilder = app.New();
var predicate = pipelineBuilderFunc.Invoke(app);
var predicate = pipelineBuilderFunc.Invoke(branchBuilder);
var branch = branchBuilder.Build();

var options = new MapWhenOptions
Expand Down
18 changes: 9 additions & 9 deletions src/Ocelot/Middleware/Pipeline/OcelotPipelineExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ public static OcelotRequestDelegate BuildOcelotPipeline(this IOcelotPipelineBuil
// It also sets the Request Id if anything is set globally
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
builder.MapWhen(context => context.HttpContext.WebSockets.IsWebSocketRequest,
app =>
Expand All @@ -57,6 +48,15 @@ public static OcelotRequestDelegate BuildOcelotPipeline(this IOcelotPipelineBuil
// Then we get the downstream route information
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?
builder.UseHttpHeadersTransformationMiddleware();

Expand Down

0 comments on commit 8711b07

Please sign in to comment.