Opened 15 years ago
Last modified 15 years ago
#52 closed defect (FIXED)
Ignore trailing slash in most URLs
| Reported by: | Aaron Williamson | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Keywords: | ||
| Cc: | Parent Tickets: |
Description
We should treat /u/aaron/ the same as /u/aaron rather than returning a 404. (Should this be true of URLs ending in a file extension or not?)
Change History (4)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
| Status: | New → Closed |
|---|
Fixed, see https://gitorious.org/mediagoblin/mediagoblin/commit/7222955fbad9d21542e71dafa910973a9cb0e676
So Sebastian Spaeth, may be useful for you to know in the future: we do support trailing slash appending just like in django actually already, but the way it works is that you have to have the URL in your routes end in /. Then if you visit it without the / at the end, it adds it (which is the way django does it also). We should try and have our URLs always end in / unless it makes sense to do otherwise probably.
Anyway, good catch, thanks! :)
comment:3 by , 15 years ago
Thanks for the fix/info, Christopher. Maybe we need a coding standards wiki for information like this?

Yes we should. And this is something that should not be solved in the individual url patterns, but on a framework level, IMHO. Django has some "Always append trailing slash" option and patterns can them assume a trailing slash.
I think we should do the same, Either always append a trailing slash or always cut it off before handing the URL to the URL matcher. Is there a downside to this?