Redirects don't honor APPEND_SLASH
|Reported by:||aaugustin||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
seanbrant reports on IRC that the following command no longer works.
pip install https://www.djangoproject.com/download/1.5c1/tarball/
/download/1.5c1/tarball/ is a URL in the redirect table. But pip strips the trailing slash, and despite APPEND_SLASH = True, Django doesn't restore it.
It could be a side effect of the upgrade of djangoproject.com to 1.4 this morning but I haven't found a corresponding change.
I don't understand how RedirectFallbackMiddleware deals with APPEND_SLASH. APPEND_SLASH tests if the resulting URL exists, and if not, it doesn't add a slash. Since RedirectFallbackMiddleware only handles 404, it can never operate on an URL processed by APPEND_SLASH.
Therefore, I believe the fallback lookup should be:
Redirect.objects.get(site__id__exact=current_site.id, old_path=path + '/')
(which doesn't make any sense to me, actually).
Change History (12)
comment:5 Changed 4 years ago by Aymeric Augustin <aymeric.augustin@…>
- Resolution set to fixed
- Status changed from new to closed