Skip to content

Commit bb83253

Browse files
committed
Revert MultiplexingMiddleware
1 parent 9cf9bc1 commit bb83253

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/Ocelot/Multiplexer/MultiplexingMiddleware.cs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,11 @@ private IEnumerable<Task<HttpContext>> ProcessRouteWithComplexAggregation(Aggreg
166166
JToken jObject, HttpContext httpContext, DownstreamRoute downstreamRoute)
167167
{
168168
var processing = new List<Task<HttpContext>>();
169-
var values = jObject.SelectTokens(matchAdvancedAgg.JsonPath).Select(s => s.ToString()).Distinct()
170-
.ToList();
169+
var values = jObject.SelectTokens(matchAdvancedAgg.JsonPath).Select(s => s.ToString()).Distinct();
171170
foreach (var value in values)
172171
{
173-
var tPnv = new List<PlaceholderNameAndValue>(httpContext.Items.TemplatePlaceholderNameAndValues())
174-
{
175-
new('{' + matchAdvancedAgg.Parameter + '}', value),
176-
};
172+
var tPnv = httpContext.Items.TemplatePlaceholderNameAndValues();
173+
tPnv.Add(new PlaceholderNameAndValue('{' + matchAdvancedAgg.Parameter + '}', value));
177174
processing.Add(ProcessRouteAsync(httpContext, downstreamRoute, tPnv));
178175
}
179176

@@ -258,16 +255,6 @@ protected virtual Task MapAsync(HttpContext httpContext, Route route, List<HttpC
258255
return Task.CompletedTask;
259256
}
260257

261-
// ensure each context retains its correct aggregate key for proper response mapping
262-
if (route.DownstreamRouteConfig != null && route.DownstreamRouteConfig.Count > 0)
263-
{
264-
for (int i = 0; i < contexts.Count && i < route.DownstreamRouteConfig.Count; i++)
265-
{
266-
var key = route.DownstreamRouteConfig[i].RouteKey;
267-
contexts[i].Items["CurrentAggregateRouteKey"] = key;
268-
}
269-
}
270-
271258
var aggregator = _factory.Get(route);
272259
return aggregator.Aggregate(route, httpContext, contexts);
273260
}

0 commit comments

Comments
 (0)