Fixed a policheck violation
This commit is contained in:
parent
20967cfa76
commit
c5b7a3f710
|
|
@ -270,11 +270,11 @@ namespace Microsoft.AspNetCore.Routing.Template
|
||||||
// If the last segment of template is optional, then request can match the
|
// 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,
|
// 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:
|
// 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
|
// Template: {p1}/{p2}.{p3?}. If the request is one/two.three it will match right away
|
||||||
// giving p3 value of moo. But if the request is foo/bar, we start matching from the
|
// giving p3 value of three. But if the request is one/two, we start matching from the
|
||||||
// rightmost giving p3 the value of bar, then we end up not matching the segment.
|
// 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
|
// 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 &&
|
if (routeSegment.Parts[indexOfLastSegment].IsOptional &&
|
||||||
routeSegment.Parts[indexOfLastSegment - 1].IsOptionalSeperator)
|
routeSegment.Parts[indexOfLastSegment - 1].IsOptionalSeperator)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue