mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 04:17:03 +00:00
implement #1536 with (SetRegisterRule(iris.RouteOverlap))
Former-commit-id: 2b5523ff3e2aab60dd83faa3c520b16a34916fbe
This commit is contained in:
@@ -66,6 +66,9 @@ type Route struct {
|
||||
|
||||
// ReadOnly is the read-only structure of the Route.
|
||||
ReadOnly context.RouteReadOnly
|
||||
|
||||
// OnBuild runs right before BuildHandlers.
|
||||
OnBuild func(r *Route)
|
||||
}
|
||||
|
||||
// NewRoute returns a new route based on its method,
|
||||
@@ -186,6 +189,10 @@ func (r *Route) RestoreStatus() bool {
|
||||
// at the `Application#Build` state. Do not call it manually, unless
|
||||
// you were defined your own request mux handler.
|
||||
func (r *Route) BuildHandlers() {
|
||||
if r.OnBuild != nil {
|
||||
r.OnBuild(r)
|
||||
}
|
||||
|
||||
if len(r.beginHandlers) > 0 {
|
||||
r.Handlers = append(r.beginHandlers, r.Handlers...)
|
||||
r.beginHandlers = r.beginHandlers[0:0]
|
||||
|
||||
Reference in New Issue
Block a user