1f6e689e by astaxie

beego: fix #652

1 parent af4f1538
...@@ -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,7 +259,9 @@ func addPrefix(t *Tree, prefix string) { ...@@ -258,7 +259,9 @@ 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 {
261 c.pattern = prefix + c.pattern 262 if !strings.HasPrefix(c.pattern, prefix) {
263 c.pattern = prefix + c.pattern
264 }
262 } 265 }
263 } 266 }
264 267
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!