/// <summary> /// http://{prefix}/{name}/{method} /// </summary> public bool IsMatch(HttpListenerRequest Request, string prefix) { string fpath = Request.GetFilePath(prefix); if (string.IsNullOrEmpty(fpath) || fpath.Contains("/")) { return(false); } else { return(_services.ContainsKey(fpath)); } }
public bool IsMatch(HttpListenerRequest Request, string prefix) { string url = Request.GetFilePath(prefix); return(_rules.Exists(r => Regex.IsMatch(url, r.Pattern))); }