#12790: redirect_to in django.contrib.auth.views.* must be urlquoted
----------------------------+-----------------------------------------------
Reporter: slav0nic | Owner: nobody
Status: new | Milestone:
Component: Authentication | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 1 |
----------------------------+-----------------------------------------------
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 ?
--
Ticket URL: <http://code.djangoproject.com/ticket/12790>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.