diff --git a/tree.go b/tree.go index 72f9373c..28b515ff 100644 --- a/tree.go +++ b/tree.go @@ -284,6 +284,8 @@ func (t *Tree) addseg(segments []string, route interface{}, wildcards []string, // Match router to runObject & params func (t *Tree) Match(pattern string, ctx *context.Context) (runObject interface{}) { + // fix issue 4961, deal with "./ ../ //" + pattern = path.Clean(pattern) if len(pattern) == 0 || pattern[0] != '/' { return nil }