mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-13 18:00:05 +00:00
fix append (different behaviour in arm)
This commit is contained in:
@@ -32,10 +32,13 @@ func (r *Router) Use(h Handler) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Router) For(path string, handler Handler) {
|
func (r *Router) For(path string, handler Handler) {
|
||||||
|
chain := make([]Handler, 0)
|
||||||
|
chain = append(chain, r.middle...)
|
||||||
|
chain = append(chain, handler)
|
||||||
|
|
||||||
x := Route{}
|
x := Route{}
|
||||||
x.regex = routeRegexp(path)
|
x.regex = routeRegexp(path)
|
||||||
x.chain = append(r.middle, handler)
|
x.chain = chain
|
||||||
|
|
||||||
r.routes = append(r.routes, x)
|
r.routes = append(r.routes, x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user