mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 20:50:54 +00:00
fix router's /path/
This commit is contained in:
parent
572e281566
commit
a997ca746f
@ -386,7 +386,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
|
|
||||||
if (requestPath[n-1] != '/' && route.pattern == requestPath) ||
|
if (requestPath[n-1] != '/' && route.pattern == requestPath) ||
|
||||||
(requestPath[n-1] == '/' && len(route.pattern) >= n-1 && requestPath[0:n-1] == route.pattern) ||
|
(requestPath[n-1] == '/' && len(route.pattern) >= n-1 && requestPath[0:n-1] == route.pattern) ||
|
||||||
(len(route.pattern)-1 == n && requestPath == route.pattern[:n-1]) {
|
(len(route.pattern) == n+1 && requestPath == route.pattern[0:n]) {
|
||||||
runrouter = route
|
runrouter = route
|
||||||
findrouter = true
|
findrouter = true
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user