fix no slash req path

Former-commit-id: 3c3c00788e2481ee142b668d576cab5ff046f089
This commit is contained in:
Gerasimos (Makis) Maropoulos 2018-10-21 19:21:23 +03:00
parent a0c8369927
commit 8baaddc892

View File

@ -168,11 +168,12 @@ func (tr *trie) insert(path, routeName string, handlers context.Handlers) {
func (tr *trie) search(q string, params *context.RequestParams) *trieNode { func (tr *trie) search(q string, params *context.RequestParams) *trieNode {
end := len(q) end := len(q)
n := tr.root
if end == 1 && q[0] == pathSepB { if end == 0 || (end == 1 && q[0] == pathSepB) {
return n.getChild(pathSep) return tr.root.getChild(pathSep)
} }
n := tr.root
start := 1 start := 1
i := 1 i := 1
var paramValues []string var paramValues []string