diff --git a/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs b/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs index 68a6763606..d70cd6eece 100644 --- a/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs +++ b/test/Microsoft.AspNetCore.Routing.Tests/Matchers/BarebonesMatcher.cs @@ -31,9 +31,10 @@ namespace Microsoft.AspNetCore.Routing.Matchers throw new ArgumentNullException(nameof(feature)); } + var path = httpContext.Request.Path.Value; for (var i = 0; i < Matchers.Length; i++) { - if (Matchers[i].TryMatch(httpContext.Request.Path.Value)) + if (Matchers[i].TryMatch(path)) { feature.Endpoint = Matchers[i].Endpoint; feature.Values = new RouteValueDictionary();