From d3be8e5a98fb3e4f71ddd479faafc631bcf99ffe Mon Sep 17 00:00:00 2001 From: Bruce Zhang Date: Sun, 20 Nov 2016 22:12:33 +0800 Subject: [PATCH] fix the issue:if the router path is /user/:name/*action, you will get the value of action param is /*{action} --- tree.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tree.go b/tree.go index 4f1da271..74d3e6b7 100644 --- a/tree.go +++ b/tree.go @@ -280,7 +280,8 @@ func (n *node) insertChild(numParams uint8, path string, fullPath string, handle panic("wildcards must be named with a non-empty name in path '" + fullPath + "'") } - if c == ':' { // param + // any wildcard is param + if c == ':' || c == '*' { // param // split path at the beginning of the wildcard if i > 0 { n.path = path[offset:i]