Feature/fix #194 (#196)

* added failing acceptance test

* added validation for double slash in upstream and downstream path templates
This commit is contained in:
Tom Pallister
2018-01-10 18:11:56 +00:00
committed by GitHub
parent b909b34591
commit 852f11c423
2 changed files with 57 additions and 3 deletions

View File

@ -19,6 +19,14 @@ namespace Ocelot.Configuration.Validator
.Must(path => path.StartsWith("/"))
.WithMessage("{PropertyName} {PropertyValue} doesnt start with forward slash");
RuleFor(reRoute => reRoute.UpstreamPathTemplate)
.Must(path => !path.Contains("//"))
.WithMessage("{PropertyName} {PropertyValue} contains double forward slash, Ocelot does not support this at the moment. Please raise an issue in GitHib if you need this feature.");
RuleFor(reRoute => reRoute.DownstreamPathTemplate)
.Must(path => !path.Contains("//"))
.WithMessage("{PropertyName} {PropertyValue} contains double forward slash, Ocelot does not support this at the moment. Please raise an issue in GitHib if you need this feature.");
RuleFor(reRoute => reRoute.UpstreamPathTemplate)
.Must(path => path.StartsWith("/"))
.WithMessage("{PropertyName} {PropertyValue} doesnt start with forward slash");