mirror of
https://github.com/kataras/iris.git
synced 2026-03-10 18:35:57 +00:00
nothing special here
This commit is contained in:
10
http.go
10
http.go
@@ -1335,8 +1335,9 @@ type (
|
||||
}
|
||||
|
||||
serveMux struct {
|
||||
tree *muxTree
|
||||
lookups []*route
|
||||
tree *muxTree
|
||||
lookups []*route
|
||||
maxParameters uint8
|
||||
|
||||
onLookup func(Route)
|
||||
|
||||
@@ -1454,6 +1455,7 @@ func (mux *serveMux) build() (func(reqCtx *fasthttp.RequestCtx) string, func([]b
|
||||
if tree == nil {
|
||||
//first time we register a route to this method with this domain
|
||||
tree = &muxTree{method: r.method, subdomain: r.subdomain, entry: &muxEntry{}, next: nil}
|
||||
|
||||
if mux.tree == nil {
|
||||
// it's the first entry
|
||||
mux.tree = tree
|
||||
@@ -1474,6 +1476,10 @@ func (mux *serveMux) build() (func(reqCtx *fasthttp.RequestCtx) string, func([]b
|
||||
if err := tree.entry.add(r.path, r.middleware); err != nil {
|
||||
mux.logger.Panic(err.Error())
|
||||
}
|
||||
|
||||
if mp := tree.entry.paramsLen; mp > mux.maxParameters {
|
||||
mux.maxParameters = mp
|
||||
}
|
||||
}
|
||||
|
||||
// optimize this once once, we could do that: context.RequestPath(mux.escapePath), but we lose some nanoseconds on if :)
|
||||
|
||||
Reference in New Issue
Block a user