﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19772	Redirects don't honor APPEND_SLASH	Aymeric Augustin	nobody	"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 [https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py#L16 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 + '/')
}}}
rather than:
{{{
Redirect.objects.get(site__id__exact=current_site.id, old_path__exact=path[:path.rfind('/')]+path[path.rfind('/')+1:])
}}}
(which doesn't make any sense to me, actually)."	Bug	closed	contrib.redirects	1.4	Normal	fixed			Accepted	0	0	0	0	0	0
