fixes issue #117

This commit is contained in:
Tom Gardham-Pallister
2017-08-29 20:47:52 +01:00
parent 41e9dfac94
commit 7ef26f5f4b
4 changed files with 81 additions and 4 deletions

View File

@ -6,6 +6,7 @@ using Ocelot.Configuration.Provider;
using Ocelot.DownstreamRouteFinder.UrlMatcher;
using Ocelot.Errors;
using Ocelot.Responses;
using Ocelot.Utilities;
namespace Ocelot.DownstreamRouteFinder.Finder
{
@ -24,6 +25,8 @@ namespace Ocelot.DownstreamRouteFinder.Finder
public async Task<Response<DownstreamRoute>> FindDownstreamRoute(string upstreamUrlPath, string upstreamHttpMethod)
{
upstreamUrlPath = upstreamUrlPath.SetLastCharacterAs('/');
var configuration = await _configProvider.Get();
var applicableReRoutes = configuration.Data.ReRoutes.Where(r => r.UpstreamHttpMethod.Count == 0 || r.UpstreamHttpMethod.Select(x => x.Method.ToLower()).Contains(upstreamHttpMethod.ToLower()));

View File

@ -30,7 +30,7 @@ namespace Ocelot.DownstreamRouteFinder.Middleware
public async Task Invoke(HttpContext context)
{
var upstreamUrlPath = context.Request.Path.ToString().SetLastCharacterAs('/');
var upstreamUrlPath = context.Request.Path.ToString();
_logger.LogDebug("upstream url path is {upstreamUrlPath}", upstreamUrlPath);