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

Expose FindRoute on Mux to enable access to it in custom middleware #774

Open
IDispose opened this issue Dec 21, 2022 · 2 comments
Open

Comments

@IDispose
Copy link

We are building a custom middleware which needs to know the route that matched the current request path. Unfortunately, the only available option Match just returns a yay or nay. Since this method has access to the actual route that matches, can we add a FindRoute on Mux that will delegate the actual work to tree.FindRoute ?

Is there an alternate way to determine the route that matches the current http request path in a custom middleware?

@insano10
Copy link

I need to do the same thing. I cannot see a workaround other than re-implementing FindRoute with the input of mux.Routes(). I'm happy to raise a PR for this if the maintainers are open to it.

@davidspiess
Copy link

Also looking for the same feature.

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

3 participants