﻿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
19488	Locale middleware with settings.APPEND_SLASH enabled is buggy (doesn't redirect) with valid URLs not ending with slash	danger@…	nobody	"Hello,

the locale middleware does not handle the case when settings.APPEND_SLASH is enabled and a valid URL that doesn't end with slash is accessed. Example:

{{{
i18n url pattern ^sitemap\.xml$
}}}

I access domain.tld/sitemap.xml

The middleware checks if settings.APPEND_SLASH and not language_path.endswith('/') and in that case appends '/' to the url, so we get something like language_path=u'/en/sitemap.xml/'.

That in turn does not match any of the urls because our regexp doesn't allow slash at the end for sitemap.xml and we get 404 instead of redirect to /en/sitemap.xml.

My pull request is at https://github.com/django/django/pull/591"	Bug	closed	Core (Other)	1.4	Normal	fixed	redirect, i18n, locale middleware		Accepted	1	0	0	0	0	0
