From c280209bf5b94cf31094a200b166c97eb3898851 Mon Sep 17 00:00:00 2001 From: GuoHuiPeng <1205504832@qq.com> Date: Thu, 21 Jul 2022 00:33:11 +0800 Subject: [PATCH] Fix issue 4961 (#5025) Signed-off-by: GuoHuiPeng <1205504832@qq.com> --- tree.go | 2 ++ 1 file changed, 2 insertions(+) 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 }