From 8baaddc89268d1187482e88af4ea945920b9d9ac Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sun, 21 Oct 2018 19:21:23 +0300 Subject: [PATCH] fix no slash req path Former-commit-id: 3c3c00788e2481ee142b668d576cab5ff046f089 --- core/router/trie.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/router/trie.go b/core/router/trie.go index 2d11e257..9e98efbb 100644 --- a/core/router/trie.go +++ b/core/router/trie.go @@ -168,11 +168,12 @@ func (tr *trie) insert(path, routeName string, handlers context.Handlers) { func (tr *trie) search(q string, params *context.RequestParams) *trieNode { end := len(q) - n := tr.root - if end == 1 && q[0] == pathSepB { - return n.getChild(pathSep) + + if end == 0 || (end == 1 && q[0] == pathSepB) { + return tr.root.getChild(pathSep) } + n := tr.root start := 1 i := 1 var paramValues []string