Skip to content

Commit f1572c4

Browse files
author
Sergio Andres Virviescas Santana
committed
Fix list
1 parent 45fea56 commit f1572c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

router.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,13 @@ func (r *Router) Handle(method, path string, handle fasthttp.RequestHandler) {
216216
if path[0] != '/' {
217217
panic("path must begin with '/' in path '" + path + "'")
218218
}
219+
219220
if r.beginPath != "/" {
220221
path = r.beginPath + path
221222
}
222223

224+
r.registeredPaths[method] = append(r.registeredPaths[method], path)
225+
223226
// Call to the parent recursively until main router to register paths in it
224227
if r.parent != nil {
225228
r.parent.Handle(method, path, handle)
@@ -232,8 +235,6 @@ func (r *Router) Handle(method, path string, handle fasthttp.RequestHandler) {
232235
r.trees[method] = root
233236
}
234237

235-
r.registeredPaths[method] = append(r.registeredPaths[method], path)
236-
237238
optionalPaths := getOptionalPaths(path)
238239

239240
// if not has optional paths, adds the original

0 commit comments

Comments
 (0)