Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
raman-m committed Jul 15, 2023
1 parent 801cc21 commit 5b5bfb0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
4 changes: 1 addition & 3 deletions docs/features/requestaggregation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,4 @@ Gotcha's / Further info

You cannot use Routes with specific RequestIdKeys as this would be crazy complicated to track.

Aggregation supports the GET HTTP Verb for pure REST, it supports other verbs for apis which do not fully follow REST.


Aggregation supports the GET HTTP Verb for pure REST. It supports other verbs for APIs which do not fully follow REST.
23 changes: 11 additions & 12 deletions src/Ocelot/Configuration/Creator/AggregatesCreator.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Collections.Generic;
using System.Linq;

using Ocelot.Configuration.Builder;

using Ocelot.Configuration.File;
using Ocelot.Configuration.Builder;
using Ocelot.Configuration.File;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;

namespace Ocelot.Configuration.Creator
{
Expand All @@ -25,12 +24,12 @@ public List<Route> Create(FileConfiguration fileConfiguration, List<Route> route
}

private Route SetUpAggregateRoute(IEnumerable<Route> routes, FileAggregateRoute aggregateRoute, FileGlobalConfiguration globalConfiguration)
{
if (!aggregateRoute.UpstreamHttpMethod.Any())
{
// Default Method to Get for standard use case
aggregateRoute.UpstreamHttpMethod.Add("Get");
}
{
if (!aggregateRoute.UpstreamHttpMethod.Any())
{
// Default method to Get for standard use case
aggregateRoute.UpstreamHttpMethod.Add(HttpMethod.Get.ToString());
}

var applicableRoutes = new List<DownstreamRoute>();
var allRoutes = routes.SelectMany(x => x.DownstreamRoute);
Expand Down
2 changes: 1 addition & 1 deletion src/Ocelot/Configuration/File/FileAggregateRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class FileAggregateRoute : IRoute
public string UpstreamHost { get; set; }
public bool RouteIsCaseSensitive { get; set; }
public string Aggregator { get; set; }
public List<string> UpstreamHttpMethod { get; private set; } = new();
public List<string> UpstreamHttpMethod { get; set; } = new();
public int Priority { get; set; } = 1;
}
}

0 comments on commit 5b5bfb0

Please sign in to comment.