From e9a236d86c82133ab1959e4ea4760ebe6f73bd8e Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Fri, 21 Jul 2006 16:20:22 +0000 Subject: 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 --- django/core/handlers/modpython.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'django/core/handlers/modpython.py') 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'): -- cgit v1.3