diff --git a/httpr.go b/httpr.go index 18d2185..d36908d 100644 --- a/httpr.go +++ b/httpr.go @@ -114,6 +114,14 @@ outer: for _, child := range curNode.children { firstChar := path[i+1][0] if (firstChar == ':' || firstChar == '*') && firstChar == child.endpoint[0] { + // Do not allow different param names, because only the first one + // is saved, so a param won't be available by a new name. + // + // I am not the one to judge, but it is a little strange to + // expect different types of param in one place. + if path[i+1] != child.endpoint { + return errors.New("param names " + path[i+1] + " and " + child.endpoint + " are differ") + } curNode = child continue outer }