summaryrefslogtreecommitdiff
path: root/django/core/handlers/modpython.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2006-07-21 16:20:22 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2006-07-21 16:20:22 +0000
commite9a236d86c82133ab1959e4ea4760ebe6f73bd8e (patch)
tree3a8f05df528fc6b5c853cb66c3718d6c33af7654 /django/core/handlers/modpython.py
parent8bdd19beea3002d8b99cbaaab9624dca8f7a8694 (diff)
Fixed #2092: added a "is_secure()" method to HttpRequest which correctly handles the subtleties of mod_python's interaction with os.environ. This one's been bugging me for about a *year*, so many many thanks to k.shaposhnikov@gmail.com for figuring it out, and Tim Shaffer for pointing out this ticket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3410 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/handlers/modpython.py')
-rw-r--r--django/core/handlers/modpython.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py
index 5a20ce9f67..8da8ca41d1 100644
--- a/django/core/handlers/modpython.py
+++ b/django/core/handlers/modpython.py
@@ -23,6 +23,9 @@ class ModPythonRequest(http.HttpRequest):
def get_full_path(self):
return '%s%s' % (self.path, self._req.args and ('?' + self._req.args) or '')
+ def is_secure(self):
+ return self._req.subprocess_env.has_key('HTTPS') and self._req.subprocess_env['HTTPS'] == 'on'
+
def _load_post_and_files(self):
"Populates self._post and self._files"
if self._req.headers_in.has_key('content-type') and self._req.headers_in['content-type'].startswith('multipart'):