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

wrap-route doesn't work for multiple routes #117

Open
Raynes opened this issue Jun 19, 2012 · 1 comment
Open

wrap-route doesn't work for multiple routes #117

Raynes opened this issue Jun 19, 2012 · 1 comment

Comments

@Raynes
Copy link
Member

Raynes commented Jun 19, 2012

I was experimenting with wrap-route because I have some middleware that I'd like to apply to two routes.

If I did something like the following:

(wrap-route [:post "/foo"] some-middleware)

it seems to work fine. However, if I do

(wrap-route [:post "/foo"] some-middleware)
(wrap-route [:post "/bar"] some-middleware)

then I get a 404 when I post to /foo.

Seems like wrap-route should be able to apply middleware to several routes at once (otherwise we're calling the same middleware function several times for no apparent reason) and several pieces of middleware at once. But that's probably a different issue entirely.

@ibdknox Thoughts? This seems like a pretty big issue. :(

@ibdknox
Copy link
Member

ibdknox commented Jun 21, 2012

I think this is the same issue that was mentioned on the list a while back. Basically we need to change Noir's internal storage of routes to wait until the packing phase before they are turned into compojure routes. This way we could ensure that wrap-route wraps inside of the url-check by wrapping before it goes to compojure's GET/POST/etc.

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