beego: fix #652
Showing
1 changed file
with
3 additions
and
0 deletions
| ... | @@ -7,6 +7,7 @@ package beego | ... | @@ -7,6 +7,7 @@ package beego |
| 7 | 7 | ||
| 8 | import ( | 8 | import ( |
| 9 | "net/http" | 9 | "net/http" |
| 10 | "strings" | ||
| 10 | 11 | ||
| 11 | beecontext "github.com/astaxie/beego/context" | 12 | beecontext "github.com/astaxie/beego/context" |
| 12 | "github.com/astaxie/beego/middleware" | 13 | "github.com/astaxie/beego/middleware" |
| ... | @@ -258,9 +259,11 @@ func addPrefix(t *Tree, prefix string) { | ... | @@ -258,9 +259,11 @@ func addPrefix(t *Tree, prefix string) { |
| 258 | } | 259 | } |
| 259 | for _, l := range t.leaves { | 260 | for _, l := range t.leaves { |
| 260 | if c, ok := l.runObject.(*controllerInfo); ok { | 261 | if c, ok := l.runObject.(*controllerInfo); ok { |
| 262 | if !strings.HasPrefix(c.pattern, prefix) { | ||
| 261 | c.pattern = prefix + c.pattern | 263 | c.pattern = prefix + c.pattern |
| 262 | } | 264 | } |
| 263 | } | 265 | } |
| 266 | } | ||
| 264 | 267 | ||
| 265 | } | 268 | } |
| 266 | 269 | ... | ... |
-
Please register or sign in to post a comment