From ab9aacd4db5d1e69ff2c78bae69fcabe5252d395 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 6 Oct 2005 02:27:08 +0000 Subject: Fixed #333 and #440 -- Split DEFAULT_MIME_TYPE setting into DEFAULT_CONTENT_TYPE and DEFAULT_CHARSET. Thanks, Maniac. git-svn-id: http://code.djangoproject.com/svn/django/trunk@786 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/handlers/modpython.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'django/core/handlers/modpython.py') diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py index 623db959b2..e52879065f 100644 --- a/django/core/handlers/modpython.py +++ b/django/core/handlers/modpython.py @@ -150,14 +150,15 @@ class ModPythonHandler(BaseHandler): def populate_apache_request(http_response, mod_python_req): "Populates the mod_python request object with an HttpResponse" - mod_python_req.content_type = http_response['Content-Type'] or httpwrappers.DEFAULT_MIME_TYPE + from django.conf import settings + mod_python_req.content_type = http_response['Content-Type'] for key, value in http_response.headers.items(): if key != 'Content-Type': mod_python_req.headers_out[key] = value for c in http_response.cookies.values(): mod_python_req.headers_out.add('Set-Cookie', c.output(header='')) mod_python_req.status = http_response.status_code - mod_python_req.write(http_response.get_content_as_string('utf-8')) + mod_python_req.write(http_response.get_content_as_string(settings.DEFAULT_CHARSET)) def handler(req): # mod_python hooks into this function. -- cgit v1.3