mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 07:30:55 +00:00
beego: support not-empty value in router fix #555
This commit is contained in:
parent
f9cc9e9eb3
commit
5a52949761
@ -109,6 +109,10 @@ func (p *ControllerRegistor) Add(pattern string, c ControllerInterface, mappingM
|
|||||||
expr = `([\w]+)`
|
expr = `([\w]+)`
|
||||||
part = part[:lindex]
|
part = part[:lindex]
|
||||||
}
|
}
|
||||||
|
//marth /user/:id! non-empty value
|
||||||
|
} else if part[len(part)-1] == '!' {
|
||||||
|
expr = `(.+)`
|
||||||
|
part = part[:len(part)-1]
|
||||||
}
|
}
|
||||||
params[j] = part
|
params[j] = part
|
||||||
parts[i] = expr
|
parts[i] = expr
|
||||||
|
Loading…
Reference in New Issue
Block a user