1
0
mirror of https://github.com/kataras/iris.git synced 2026-02-28 05:26:00 +00:00
Former-commit-id: 129d115937617e4d77b7e6e7efddf3168b15d021
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-06-18 23:53:53 +03:00
parent 43502ed047
commit 9724592697
3 changed files with 59 additions and 1 deletions

View File

@@ -115,7 +115,8 @@ func (s *Struct) Acquire(ctx context.Context) (reflect.Value, error) {
}
ctrl := ctx.Controller()
if ctrl.Kind() == reflect.Invalid {
if ctrl.Kind() == reflect.Invalid ||
ctrl.Type() != s.ptrType /* in case of changing controller in the same request (see RouteOverlap feature) */ {
ctrl = reflect.New(s.elementType)
ctx.Values().Set(context.ControllerContextKey, ctrl)
elem := ctrl.Elem()