#419 Incorrect routing when UpstreamHost is specified and UpstreamHttpMethod is empty (#420)

This commit is contained in:
David Nissimoff
2018-06-20 14:41:00 -07:00
committed by Tom Pallister
parent e636cefdb1
commit fffc4c8d3c
2 changed files with 15 additions and 1 deletions

View File

@ -49,7 +49,8 @@ namespace Ocelot.DownstreamRouteFinder.Finder
private bool RouteIsApplicableToThisRequest(ReRoute reRoute, string httpMethod, string upstreamHost)
{
return reRoute.UpstreamHttpMethod.Count == 0 || reRoute.UpstreamHttpMethod.Select(x => x.Method.ToLower()).Contains(httpMethod.ToLower()) && !(!string.IsNullOrEmpty(reRoute.UpstreamHost) && reRoute.UpstreamHost != upstreamHost);
return (reRoute.UpstreamHttpMethod.Count == 0 || reRoute.UpstreamHttpMethod.Select(x => x.Method.ToLower()).Contains(httpMethod.ToLower())) &&
(string.IsNullOrEmpty(reRoute.UpstreamHost) || reRoute.UpstreamHost == upstreamHost);
}
private DownstreamRoute GetPlaceholderNamesAndValues(string path, ReRoute reRoute)