1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 07:50:54 +00:00

Update tree.go

fix routers for:
```
/topic/:id/?:auth
/topic/:id/?:auth:int
```
This commit is contained in:
Yongzheng Lai 2015-09-06 12:01:50 +08:00
parent a89f14d80d
commit 5ad999a3d1

View File

@ -208,6 +208,11 @@ func (t *Tree) addseg(segments []string, route interface{}, wildcards []string,
} else {
t.leaves = append(t.leaves, &leafInfo{runObject: route, wildcards: wildcards})
}
for i, v := range wildcards {
if v==":" && i!=0{
t.leaves = append(t.leaves, &leafInfo{runObject: route, wildcards: wildcards[:i+1]})
}
}
} else {
seg := segments[0]
iswild, params, regexpStr := splitSegment(seg)