diff --git a/docs/features/requestaggregation.rst b/docs/features/requestaggregation.rst index f74ba4437..bfdc03af8 100644 --- a/docs/features/requestaggregation.rst +++ b/docs/features/requestaggregation.rst @@ -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. diff --git a/src/Ocelot/Configuration/Creator/AggregatesCreator.cs b/src/Ocelot/Configuration/Creator/AggregatesCreator.cs index 7665bfd82..e41d55a25 100644 --- a/src/Ocelot/Configuration/Creator/AggregatesCreator.cs +++ b/src/Ocelot/Configuration/Creator/AggregatesCreator.cs @@ -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 { @@ -25,12 +24,12 @@ public List Create(FileConfiguration fileConfiguration, List route } private Route SetUpAggregateRoute(IEnumerable 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(); var allRoutes = routes.SelectMany(x => x.DownstreamRoute); diff --git a/src/Ocelot/Configuration/File/FileAggregateRoute.cs b/src/Ocelot/Configuration/File/FileAggregateRoute.cs index 8b18b41ea..c1776a2cf 100644 --- a/src/Ocelot/Configuration/File/FileAggregateRoute.cs +++ b/src/Ocelot/Configuration/File/FileAggregateRoute.cs @@ -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 UpstreamHttpMethod { get; private set; } = new(); + public List UpstreamHttpMethod { get; set; } = new(); public int Priority { get; set; } = 1; } }