Justin Kotalik
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
3 deletions
-
src/Microsoft.Tye.Core/KubernetesManifestGenerator.cs
|
|
|
@ -92,14 +92,21 @@ namespace Microsoft.Tye |
|
|
|
//
|
|
|
|
// Therefore our rewrite-target is set to $2 - we want to make sure we have
|
|
|
|
// two capture groups.
|
|
|
|
if (string.IsNullOrEmpty(ingressRule.Path) || ingressRule.Path == "/" || ingressRule.PreservePath) |
|
|
|
if (string.IsNullOrEmpty(ingressRule.Path) || ingressRule.Path == "/") |
|
|
|
{ |
|
|
|
path.Add("path", "/()(.*)"); // () is an empty capture group.
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var regex = $"{ingressRule.Path.TrimEnd('/')}(/|$)(.*)"; |
|
|
|
path.Add("path", regex); |
|
|
|
if (ingressRule.PreservePath) |
|
|
|
{ |
|
|
|
path.Add("path", $"/()({ingressRule.Path.Trim('/')}.*)"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var regex = $"{ingressRule.Path.TrimEnd('/')}(/|$)(.*)"; |
|
|
|
path.Add("path", regex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|