1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-16 02:32:17 +00:00

improve the empty router

This commit is contained in:
astaxie
2014-12-19 15:33:51 +08:00
parent d3ab157915
commit 0c933643e2
2 changed files with 8 additions and 1 deletions

View File

@@ -422,6 +422,9 @@ func (leaf *leafInfo) match(wildcardValues []string) (ok bool, params map[string
// "/admin/" -> ["admin"]
// "/admin/users" -> ["admin", "users"]
func splitPath(key string) []string {
if key == "" {
return []string{}
}
elements := strings.Split(key, "/")
if elements[0] == "" {
elements = elements[1:]