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

Allow * in paths #29

Closed
raphael opened this issue Mar 31, 2016 · 5 comments
Closed

Allow * in paths #29

raphael opened this issue Mar 31, 2016 · 5 comments

Comments

@raphael
Copy link
Contributor

raphael commented Mar 31, 2016

In my API I need to define paths with * in them. I haven't seen a way to escape the wildcard character - maybe I missed it?

@dimfeld
Copy link
Owner

dimfeld commented Mar 31, 2016

No, this isn't currently supported. It should be pretty easy to add though. I'll take a look soon or will be glad to take a PR as well.

On Mar 31, 2016, 1:50 AM -0500, Raphaël Simonnotifications@github.com, wrote:

In my API I need to define paths with*in them. I haven't seen a way to escape the wildcard character - maybe I missed it?


You are receiving this because you are subscribed to this thread.
Reply to this email directly orview it on GitHub(#29)

@raphael
Copy link
Contributor Author

raphael commented Mar 31, 2016

Awesome! How would you see the escaping being done? \prefix? I can take a stab at it.

@dimfeld
Copy link
Owner

dimfeld commented Mar 31, 2016

Yeah that's my thought. I just had a couple hour plane ride and took advantage of the time to implement it. Will post it up later today :)

On Mar 31, 2016, 11:53 AM -0400, Raphaël Simonnotifications@github.com, wrote:

Awesome! How would you see there escaping being done?\prefix? I can take a stab at it.


You are receiving this because you commented.
Reply to this email directly orview it on GitHub(#29 (comment))

@raphael
Copy link
Contributor Author

raphael commented Mar 31, 2016

Great! looking forward to it.

@dimfeld
Copy link
Owner

dimfeld commented Mar 31, 2016

Ok, so if you put a * or : at the beginning of a path segment, it must be backslash escaped, like so router.GET("\\*asteriskpath", handler). The backslash should not be included if it occurs anywhere else in the path, e.g. router.GET("aaa*bbb", handler) as it only checks at the beginning. I'm not 100% happy with that but it makes the logic much simpler. Hope that helps!

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

2 participants