mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 00:38:16 +08:00
@ -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)
|
||||
|
@ -14,5 +14,7 @@ namespace Ocelot.Configuration.File
|
||||
{
|
||||
get { return new List<string> {"Get"}; }
|
||||
}
|
||||
|
||||
public int Priority {get;set;} = 1;
|
||||
}
|
||||
}
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
@ -4,5 +4,6 @@
|
||||
{
|
||||
string UpstreamPathTemplate { get; set; }
|
||||
bool ReRouteIsCaseSensitive { get; set; }
|
||||
int Priority {get;set;}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user