﻿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
26812	APPEND_SLASH doesn't work with URLs that have query strings	Andrzej Winnicki	nobody	"Hi,

In ''middleware/common.py'' there is a code, which checks whether the slash should be appended to URL.

{{{
def should_redirect_with_slash(self, request):
        """"""
        Return True if settings.APPEND_SLASH is True and appending a slash to
        the request path turns an invalid path into a valid one.
        """"""

        if settings.APPEND_SLASH and not request.get_full_path().endswith('/'):
            urlconf = getattr(request, 'urlconf', None)

            return (
                not urlresolvers.is_valid_path(request.path_info, urlconf)
                and urlresolvers.is_valid_path('%s/' % request.path_info, urlconf)
            )
        return False
}}}

In most cases it works fine, but it fails to append slash, when used with LOGIN_URL without slash and with ""next"" parameter. For example:

It works fine:'' /accounts/login/?next=/polls/3/'' -> LOGIN_URL = ''/accounts/login/''
But this one returns 404: ''/accounts/login?next=/polls/3/'' -> LOGIN_URL = ''/accounts/login (no trailing slash).''

It is because: ''request.get_full_path().endswith('/')'' checks also query string and therefore returns true and the slash is never appended.
"	Bug	closed	HTTP handling	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
