Commit 1f6e689e authored by astaxie's avatar astaxie

beego: fix #652

parent af4f1538
...@@ -7,6 +7,7 @@ package beego ...@@ -7,6 +7,7 @@ package beego
import ( import (
"net/http" "net/http"
"strings"
beecontext "github.com/astaxie/beego/context" beecontext "github.com/astaxie/beego/context"
"github.com/astaxie/beego/middleware" "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) {
} }
for _, l := range t.leaves { for _, l := range t.leaves {
if c, ok := l.runObject.(*controllerInfo); ok { if c, ok := l.runObject.(*controllerInfo); ok {
c.pattern = prefix + c.pattern if !strings.HasPrefix(c.pattern, prefix) {
c.pattern = prefix + c.pattern
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment