1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 03:00:49 +00:00

Merge pull request #3905 from ywk253100/200110_context

Send the request from context rather than the original one to handlers
This commit is contained in:
astaxie 2020-02-07 11:05:01 +08:00 committed by GitHub
commit 96f01079cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -773,7 +773,7 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
}
} else if routerInfo.routerType == routerTypeHandler {
isRunnable = true
routerInfo.handler.ServeHTTP(rw, r)
routerInfo.handler.ServeHTTP(context.ResponseWriter, context.Request)
} else {
runRouter = routerInfo.controllerType
methodParams = routerInfo.methodParams