1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-18 12:14:15 +00:00

beego: support not-empty value in router fix #555

This commit is contained in:
astaxie 2014-04-09 21:42:57 +08:00
parent 78991c81ab
commit aa68ffecec

View File

@ -109,6 +109,10 @@ func (p *ControllerRegistor) Add(pattern string, c ControllerInterface, mappingM
expr = `([\w]+)`
part = part[:lindex]
}
//marth /user/:id! non-empty value
} else if part[len(part)-1] == '!' {
expr = `(.+)`
part = part[:len(part)-1]
}
params[j] = part
parts[i] = expr