iris
iris copied to clipboard
about RemoveHandler again
hi @kataras , another question here !
this case can remove handler successful
func Route(r router.Party) {
r.Use(middleware.Foo)
r.Get("/foo", ctrl.Index).RemoveHandler(middleware.Foo)
}
but this case failed
func Route(r *iris.APIContainer) {
sub := r.Party("/sub-r")
sub.Use(middleware.Foo)
sub.Get("/foo", ctrl.Index).RemoveHandler(middleware.Foo)
}
the difference is r router.Party and r *iris.APIContainer

and i find that middleware.Foo do not in r.Handlers
actually the handler that use in app.UseGlobal(...) can find in this r.Handlers ,
It bothers me a lot, and i think it is a bug, all the handlers shoud be added to []Handler
Originally posted by @sado0823 in https://github.com/kataras/iris/issues/1713#issuecomment-786394147
this change the original handlers, and set it to doneHandlers, when removeHandlers, it can not find the original handlers

@kataras is this a problem?