Esempio n. 1
0
 internal static bool IsGoodMatch(Router.Dest dest, string path)
 {
     if (Slash.CountIn(dest.prefix) > 1)
     {
         return(true);
     }
     // We want to match (/foo, :a) for /foo/bar/blah and (/, :a) for /123
     // but NOT / for /foo or (/, :a) for /foo or /foo/ because default route
     // (FooController#index) for /foo and /foo/ takes precedence.
     if (dest.prefix.Length == 1)
     {
         return(dest.pathParams.Count > 0 && !MaybeController(path));
     }
     return(dest.pathParams.Count > 0 || (path.EndsWith("/") && Slash.CountIn(path) ==
                                          2));
 }