mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 02:51:28 +00:00
runnable typo fixed
This commit is contained in:
parent
39e29caf9b
commit
7ef9b3d55b
@ -717,18 +717,18 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
if doFilter(BeforeExec) {
|
if doFilter(BeforeExec) {
|
||||||
goto Admin
|
goto Admin
|
||||||
}
|
}
|
||||||
isRunable := false
|
isRunnable := false
|
||||||
if routerInfo != nil {
|
if routerInfo != nil {
|
||||||
if routerInfo.routerType == routerTypeRESTFul {
|
if routerInfo.routerType == routerTypeRESTFul {
|
||||||
if _, ok := routerInfo.methods[r.Method]; ok {
|
if _, ok := routerInfo.methods[r.Method]; ok {
|
||||||
isRunable = true
|
isRunnable = true
|
||||||
routerInfo.runFunction(context)
|
routerInfo.runFunction(context)
|
||||||
} else {
|
} else {
|
||||||
exception("405", context)
|
exception("405", context)
|
||||||
goto Admin
|
goto Admin
|
||||||
}
|
}
|
||||||
} else if routerInfo.routerType == routerTypeHandler {
|
} else if routerInfo.routerType == routerTypeHandler {
|
||||||
isRunable = true
|
isRunnable = true
|
||||||
routerInfo.handler.ServeHTTP(rw, r)
|
routerInfo.handler.ServeHTTP(rw, r)
|
||||||
} else {
|
} else {
|
||||||
runrouter = routerInfo.controllerType
|
runrouter = routerInfo.controllerType
|
||||||
@ -750,7 +750,7 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// also defined runrouter & runMethod from filter
|
// also defined runrouter & runMethod from filter
|
||||||
if !isRunable {
|
if !isRunnable {
|
||||||
//Invoke the request handler
|
//Invoke the request handler
|
||||||
vc := reflect.New(runrouter)
|
vc := reflect.New(runrouter)
|
||||||
execController, ok := vc.Interface().(ControllerInterface)
|
execController, ok := vc.Interface().(ControllerInterface)
|
||||||
|
Loading…
Reference in New Issue
Block a user