未验证 提交 3b6d634f 编写于 作者: M Ming Deng 提交者: GitHub

Merge pull request #4 from flycash/fix-bug-1.x

Fix BUG: /abc.html/aaa match /abc/aaa
......@@ -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) {
if strings.HasSuffix(seg, str) && strings.HasSuffix(treePattern, seg) {
for _, subTree := range t.fixrouters {
if subTree.prefix == seg[:len(seg)-len(str)] {
runObject = subTree.match(treePattern, pattern, wildcardValues, ctx)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册