diff --git a/tree.go b/tree.go index 60a7f9e8..72f9373c 100644 --- a/tree.go +++ b/tree.go @@ -341,7 +341,7 @@ func (t *Tree) match(treePattern string, pattern string, wildcardValues []string if runObject == nil && len(t.fixrouters) > 0 { // Filter the .json .xml .html extension for _, str := range allowSuffixExt { - if strings.HasSuffix(seg, str) && strings.HasSuffix(treePattern, seg) { + if strings.HasSuffix(seg, str) && pattern == "" { for _, subTree := range t.fixrouters { // strings.HasSuffix(treePattern, seg) avoid cases: /aaa.html/bbb could access /aaa/bbb if subTree.prefix == seg[:len(seg)-len(str)] {