Merge pull request #4923 from flycash/dev1.x
pick the fix 4459: /abc.html/aaa match /abc/aaa
This commit is contained in:
commit
8524b62477
3
tree.go
3
tree.go
@ -341,8 +341,9 @@ func (t *Tree) match(treePattern string, pattern string, wildcardValues []string
|
|||||||
if runObject == nil && len(t.fixrouters) > 0 {
|
if runObject == nil && len(t.fixrouters) > 0 {
|
||||||
// Filter the .json .xml .html extension
|
// Filter the .json .xml .html extension
|
||||||
for _, str := range allowSuffixExt {
|
for _, str := range allowSuffixExt {
|
||||||
if strings.HasSuffix(seg, str) {
|
if strings.HasSuffix(seg, str) && strings.HasSuffix(treePattern, seg) {
|
||||||
for _, subTree := range t.fixrouters {
|
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)] {
|
if subTree.prefix == seg[:len(seg)-len(str)] {
|
||||||
runObject = subTree.match(treePattern, pattern, wildcardValues, ctx)
|
runObject = subTree.match(treePattern, pattern, wildcardValues, ctx)
|
||||||
if runObject != nil {
|
if runObject != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user