#270 exposed ReRoute priority (#272)

This commit is contained in:
Tom Pallister
2018-03-13 20:31:22 +00:00
committed by GitHub
parent 16c70e8b65
commit fd2c5364fc
7 changed files with 128 additions and 3 deletions

View File

@ -42,7 +42,7 @@ namespace Ocelot.Configuration.Creator
if (upstreamTemplate == "/")
{
return new UpstreamPathTemplate(RegExForwardSlashOnly, 1);
return new UpstreamPathTemplate(RegExForwardSlashOnly, reRoute.Priority);
}
if(upstreamTemplate.EndsWith("/"))
@ -54,7 +54,7 @@ namespace Ocelot.Configuration.Creator
? $"^{upstreamTemplate}{RegExMatchEndString}"
: $"^{RegExIgnoreCase}{upstreamTemplate}{RegExMatchEndString}";
return new UpstreamPathTemplate(route, 1);
return new UpstreamPathTemplate(route, reRoute.Priority);
}
private bool ForwardSlashAndOnePlaceHolder(string upstreamTemplate, List<string> placeholders, int postitionOfPlaceHolderClosingBracket)

View File

@ -14,5 +14,7 @@ namespace Ocelot.Configuration.File
{
get { return new List<string> {"Get"}; }
}
public int Priority {get;set;} = 1;
}
}

View File

@ -20,6 +20,7 @@ namespace Ocelot.Configuration.File
UpstreamHeaderTransform = new Dictionary<string, string>();
DownstreamHostAndPorts = new List<FileHostAndPort>();
DelegatingHandlers = new List<string>();
Priority = 1;
}
public string DownstreamPathTemplate { get; set; }
@ -46,5 +47,6 @@ namespace Ocelot.Configuration.File
public string UpstreamHost { get; set; }
public string Key { get;set; }
public List<string> DelegatingHandlers {get;set;}
public int Priority { get;set; }
}
}

View File

@ -4,5 +4,6 @@
{
string UpstreamPathTemplate { get; set; }
bool ReRouteIsCaseSensitive { get; set; }
int Priority {get;set;}
}
}