From 39c53b4bf383214cf2bfa034b2ba684057d9ff25 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Sep 2009 22:05:23 +0000 Subject: [PATCH] [1.1.X] Fixed #11660 -- Corrected the CONTENT_TYPE and CONTENT_LENGTH headers provided by the mod_python handler. Thanks to Nowell Strite and Tareque Hossain for the report and fix. Merge of r11528 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11530 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- AUTHORS | 3 ++- django/core/handlers/modpython.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 58179e111a..d1bac3e949 100644 --- a/AUTHORS +++ b/AUTHORS @@ -202,6 +202,7 @@ answer newbie questions, and generally made Django that much better: Kieran Holland Sung-Jin Hong Leo "hylje" Honkanen + Tareque Hossain Richard House Robert Rock Howard John Huddleston @@ -401,7 +402,7 @@ answer newbie questions, and generally made Django that much better: Vasiliy Stavenko Thomas Steinacher Johan C. Stöver - nowell strite + Nowell Strite Thomas Stromberg Pascal Varet SuperJared diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py index c6dcf23e9a..b1e3e17227 100644 --- a/django/core/handlers/modpython.py +++ b/django/core/handlers/modpython.py @@ -134,8 +134,8 @@ class ModPythonRequest(http.HttpRequest): if not hasattr(self, '_meta'): self._meta = { 'AUTH_TYPE': self._req.ap_auth_type, - 'CONTENT_LENGTH': self._req.clength, # This may be wrong - 'CONTENT_TYPE': self._req.content_type, # This may be wrong + 'CONTENT_LENGTH': self._req.headers_in.get('content-length', 0), + 'CONTENT_TYPE': self._req.headers_in.get('content-type'), 'GATEWAY_INTERFACE': 'CGI/1.1', 'PATH_INFO': self.path_info, 'PATH_TRANSLATED': None, # Not supported