diff --git a/src/Microsoft.AspNetCore.Routing/Template/TemplateMatcher.cs b/src/Microsoft.AspNetCore.Routing/Template/TemplateMatcher.cs index 4e445b02c0..e7cc2ab9f5 100644 --- a/src/Microsoft.AspNetCore.Routing/Template/TemplateMatcher.cs +++ b/src/Microsoft.AspNetCore.Routing/Template/TemplateMatcher.cs @@ -270,11 +270,11 @@ namespace Microsoft.AspNetCore.Routing.Template // If the last segment of template is optional, then request can match the // template with or without the last parameter. So we start with regular matching, // but if it doesn't match, we start with next to last parameter. Example: - // Template: {p1}/{p2}.{p3?}. If the request is foo/bar.moo it will match right away - // giving p3 value of moo. But if the request is foo/bar, we start matching from the - // rightmost giving p3 the value of bar, then we end up not matching the segment. + // Template: {p1}/{p2}.{p3?}. If the request is one/two.three it will match right away + // giving p3 value of three. But if the request is one/two, we start matching from the + // rightmost giving p3 the value of two, then we end up not matching the segment. // In this case we start again from p2 to match the request and we succeed giving - // the value bar to p2 + // the value two to p2 if (routeSegment.Parts[indexOfLastSegment].IsOptional && routeSegment.Parts[indexOfLastSegment - 1].IsOptionalSeperator) {