﻿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
12790	redirect_to in  django.contrib.auth.views.* must be urlquoted	Sergey Maranchuk	nobody	"Redirect via ''next'' param to url with unicode raise exception:


{{{
Environment:

Request Method: POST
Request URL: http://localhost:8009/login?next=/%D0%BF%D0%B8%D0%B4%D0%B0%D1%80%D0%B3%D0%B8/
Django Version: 1.1.1
Python Version: 2.5.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'testbb']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File ""/usr/lib/pymodules/python2.5/django/core/handlers/base.py"" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File ""/usr/lib/pymodules/python2.5/django/views/decorators/cache.py"" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File ""/usr/lib/pymodules/python2.5/django/contrib/auth/views.py"" in login
  30.             return HttpResponseRedirect(redirect_to)
File ""/usr/lib/pymodules/python2.5/django/http/__init__.py"" in __init__
  407.         self['Location'] = redirect_to
File ""/usr/lib/pymodules/python2.5/django/http/__init__.py"" in __setitem__
  320.         header, value = self._convert_to_ascii(header, value)
File ""/usr/lib/pymodules/python2.5/django/http/__init__.py"" in _convert_to_ascii
  309.                     value = value.encode('us-ascii')

Exception Type: UnicodeEncodeError at /login
Exception Value: 'ascii' codec can't encode characters in position 1-7: ordinal not in range(128), HTTP response headers must be in US-ASCII format

}}}

Maybe redirect url must be quoted in HttpResponseRedirect level (#11522) and problem exist not only in contrib.auth ? "		closed	contrib.auth	dev		duplicate			Unreviewed	1	0	0	0	0	0
