1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

unicode: Changed header construction for WSGI servers so that we only send

string types (not unicode that is coercable to ASII). Fixes a PEP 333 violation.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5378 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-05-29 10:20:10 +00:00
parent d879bce166
commit fa1a0532d3

View File

@ -200,8 +200,8 @@ class WSGIHandler(BaseHandler):
except KeyError:
status_text = 'UNKNOWN STATUS CODE'
status = '%s %s' % (response.status_code, status_text)
response_headers = response.headers.items()
response_headers = [(str(k), str(v)) for k, v in response.headers.items()]
for c in response.cookies.values():
response_headers.append(('Set-Cookie', c.output(header='')))
response_headers.append(('Set-Cookie', str(c.output(header=''))))
start_response(status, response_headers)
return response