Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*splat routes failing #5

Open
ghost opened this issue Jun 4, 2013 · 1 comment
Open

*splat routes failing #5

ghost opened this issue Jun 4, 2013 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 4, 2013

(since Go 1.1?)

calls to rest.Route or rest.RouteObjectMethod fail for *splat routes

rest.RouteObjectMethod("GET", "/users/*username", users, "GetUser")

problem is in the trie package:

 } else if token[0] == '*' {
            // *splat case
            name := remaining
            remaining = ""
            if self.SplatChild == nil {
                    self.SplatChild = &node{}
                    self.SplatName = name
            }
            nextNode = self.SplatChild

token is arriving in urlencoded format so '*' is replaced with '%2A' and else if condition fails; does not affect :id parameters

@ant0ine
Copy link
Owner

ant0ine commented Jun 9, 2013

Thanks for the bug report, this is definitely due to a bad handling of the urlencoded strings.
I'm gonna fix it.
Note that it also affects gp-json-rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant