1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 06:50:50 +00:00
This commit is contained in:
astaxie 2014-06-23 15:28:29 +08:00
parent af4f153830
commit 1f6e689e5d

View File

@ -7,6 +7,7 @@ package beego
import (
"net/http"
"strings"
beecontext "github.com/astaxie/beego/context"
"github.com/astaxie/beego/middleware"
@ -258,7 +259,9 @@ func addPrefix(t *Tree, prefix string) {
}
for _, l := range t.leaves {
if c, ok := l.runObject.(*controllerInfo); ok {
c.pattern = prefix + c.pattern
if !strings.HasPrefix(c.pattern, prefix) {
c.pattern = prefix + c.pattern
}
}
}