Skip to content

Have Reverse Router skip 404s #176

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

Merged
merged 2 commits into from
Jun 13, 2013
Merged

Have Reverse Router skip 404s #176

merged 2 commits into from
Jun 13, 2013

Conversation

adam-frisby
Copy link
Contributor

Adds if statement that will skip over 404 actions when reverse routing. Since 404 action does not have a controller or method, the reverse router would panic. It doesn't make sense to try to reverse route a 404 route either. Fixes #175

@robfig
Copy link
Contributor

robfig commented Jun 12, 2013

I think it would be preferable to skip any routes that don't have either a ControllerName or a MethodName (e.g. they are empty). Right now that is just 404s, but it's not hard to imagine adding other special actions like that

…outing

instead of just skipping routes with 404 actions. Will prevent any
future special actions which do not conform to ControllerName.MethodName
from causing revel to panic.
@robfig
Copy link
Contributor

robfig commented Jun 13, 2013

Thanks!

robfig added a commit that referenced this pull request Jun 13, 2013
Have Reverse Router skip 404s
@robfig robfig merged commit 16888c1 into revel:master Jun 13, 2013
@adam-frisby adam-frisby deleted the reverse-fix branch June 13, 2013 19:10
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

Successfully merging this pull request may close these issues.

Reverse Routing Panic with 404 route
2 participants