mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 23:40:35 +01:00
Fixup #778
UseGlobal call order. Former-commit-id: 293b37e6071e55aaa6c39bf12db9aed5c453c235
This commit is contained in:
parent
b2a24d36e8
commit
0d339ce91e
|
@ -149,7 +149,7 @@ func (api *APIBuilder) Handle(method string, relativePath string, handlers ...co
|
||||||
|
|
||||||
// global begin handlers -> middleware that are registered before route registration
|
// global begin handlers -> middleware that are registered before route registration
|
||||||
// -> handlers that are passed to this Handle function.
|
// -> handlers that are passed to this Handle function.
|
||||||
routeHandlers := joinHandlers(append(api.beginGlobalHandlers, api.middleware...), handlers)
|
routeHandlers := joinHandlers(api.middleware, handlers)
|
||||||
// -> done handlers after all
|
// -> done handlers after all
|
||||||
if len(api.doneGlobalHandlers) > 0 {
|
if len(api.doneGlobalHandlers) > 0 {
|
||||||
routeHandlers = append(routeHandlers, api.doneGlobalHandlers...) // register the done middleware, if any
|
routeHandlers = append(routeHandlers, api.doneGlobalHandlers...) // register the done middleware, if any
|
||||||
|
@ -164,6 +164,9 @@ func (api *APIBuilder) Handle(method string, relativePath string, handlers ...co
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add UseGlobal Handlers
|
||||||
|
r.use(api.beginGlobalHandlers)
|
||||||
|
|
||||||
// global
|
// global
|
||||||
api.routes.register(r)
|
api.routes.register(r)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user