Skip to content

Commit 5b5bfb0

Browse files
committed
code review
1 parent 801cc21 commit 5b5bfb0

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

docs/features/requestaggregation.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,4 @@ Gotcha's / Further info
181181

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

184-
Aggregation supports the GET HTTP Verb for pure REST, it supports other verbs for apis which do not fully follow REST.
185-
186-
184+
Aggregation supports the GET HTTP Verb for pure REST. It supports other verbs for APIs which do not fully follow REST.

src/Ocelot/Configuration/Creator/AggregatesCreator.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using System.Collections.Generic;
2-
using System.Linq;
3-
4-
using Ocelot.Configuration.Builder;
5-
6-
using Ocelot.Configuration.File;
1+
using Ocelot.Configuration.Builder;
2+
using Ocelot.Configuration.File;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Net.Http;
76

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

2726
private Route SetUpAggregateRoute(IEnumerable<Route> routes, FileAggregateRoute aggregateRoute, FileGlobalConfiguration globalConfiguration)
28-
{
29-
if (!aggregateRoute.UpstreamHttpMethod.Any())
30-
{
31-
// Default Method to Get for standard use case
32-
aggregateRoute.UpstreamHttpMethod.Add("Get");
33-
}
27+
{
28+
if (!aggregateRoute.UpstreamHttpMethod.Any())
29+
{
30+
// Default method to Get for standard use case
31+
aggregateRoute.UpstreamHttpMethod.Add(HttpMethod.Get.ToString());
32+
}
3433

3534
var applicableRoutes = new List<DownstreamRoute>();
3635
var allRoutes = routes.SelectMany(x => x.DownstreamRoute);

src/Ocelot/Configuration/File/FileAggregateRoute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class FileAggregateRoute : IRoute
1010
public string UpstreamHost { get; set; }
1111
public bool RouteIsCaseSensitive { get; set; }
1212
public string Aggregator { get; set; }
13-
public List<string> UpstreamHttpMethod { get; private set; } = new();
13+
public List<string> UpstreamHttpMethod { get; set; } = new();
1414
public int Priority { get; set; } = 1;
1515
}
1616
}

0 commit comments

Comments
 (0)