Fix catch all route on UpstreamTemplatePatternCreator regex to match everything (#407) (#411)

This commit is contained in:
Marco Antonio Araujo
2018-06-22 16:35:21 +01:00
committed by Tom Pallister
parent b60d26e1c6
commit 9db4273f18
2 changed files with 9 additions and 10 deletions

View File

@ -6,7 +6,7 @@ namespace Ocelot.Configuration.Creator
{
public class UpstreamTemplatePatternCreator : IUpstreamTemplatePatternCreator
{
private const string RegExMatchEverything = "[0-9a-zA-Z].*";
private const string RegExMatchOneOrMoreOfEverything = ".+";
private const string RegExMatchEndString = "$";
private const string RegExIgnoreCase = "(?i)";
private const string RegExForwardSlashOnly = "^/$";
@ -37,7 +37,7 @@ namespace Ocelot.Configuration.Creator
foreach (var placeholder in placeholders)
{
upstreamTemplate = upstreamTemplate.Replace(placeholder, RegExMatchEverything);
upstreamTemplate = upstreamTemplate.Replace(placeholder, RegExMatchOneOrMoreOfEverything);
}
if (upstreamTemplate == "/")