Skip to content

Commit

Permalink
Fix issue 4961 (#5025)
Browse files Browse the repository at this point in the history
Signed-off-by: GuoHuiPeng <1205504832@qq.com>
  • Loading branch information
GuoHuiPeng committed Jul 20, 2022
1 parent a451f39 commit c280209
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c280209

Please sign in to comment.