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

Please add a kwarg to the Route object which makes trailing slash optional #99

Open
GoogleCodeExporter opened this issue May 5, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

See attached file.

It'd be great to be able to pass a kwarg to the Route object which makes 
trailing slashes optional.  I know you can do this with a redirect, but that is 
an extra request and not strictly required.  It'd be great if you could add 
something like in my example so it fulfils the request but makes the slash 
optional.

Thanks,

Rob

Original issue reported on code.google.com by [email protected] on 22 Jan 2015 at 5:56

Attachments:

@GoogleCodeExporter
Copy link
Author

You can use 
RedirectRoute(https://webapp-improved.appspot.com/_modules/webapp2_extras/routes
.html#RedirectRoute)

using attribute strict_slash will enforce always a trailing slash in each route.

Original comment by [email protected] on 26 Feb 2015 at 11:04

@GoogleCodeExporter
Copy link
Author

RedirectRoute requires a redirect which is costly.  There is no need for a 
browser redirect in this case as webapp2 could just return the content.

Original comment by [email protected] on 26 Feb 2015 at 11:13

@GoogleCodeExporter
Copy link
Author

I can see how the recirect could be useful in certain circumstances through so 
I don't advise changing the current functionality.  I actually added this 
functionality myself by subclassing Route.

Original comment by [email protected] on 26 Feb 2015 at 11:14

@GoogleCodeExporter
Copy link
Author

That's True.. How do you actually subclass Route? I mean how do you add this 
functionality?

Original comment by [email protected] on 26 Feb 2015 at 4:43

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

No branches or pull requests

1 participant