Endpoint registering '/ep' will no longer match '/ep/x'.

Trailing slashes removed. So '/ep/' will become '/ep'.
This commit is contained in:
high 2011-09-05 15:06:08 -04:00
parent f949738db9
commit 7ae6910853
2 changed files with 6 additions and 3 deletions

View file

@ -22,7 +22,7 @@ namespace Rests
{
Name = name;
UriTemplate = uritemplate;
UriVerbMatch = string.Join("([^/]*)", Regex.Split(uritemplate, "\\{[^\\{\\}]*\\}"));
UriVerbMatch = string.Format("^{0}$", string.Join("([^/]*)", Regex.Split(uritemplate, "\\{[^\\{\\}]*\\}")));
var matches = Regex.Matches(uritemplate, "\\{([^\\{\\}]*)\\}");
UriVerbs = (from Match match in matches select match.Groups[1].Value).ToArray();
Callback = callback;