Skip to content

Commit

Permalink
Fixed #4710 -- Improved mod_python HTTPS checking. Thanks, Aaron Maxw…
Browse files Browse the repository at this point in the history
…ell, SmileyChris and Graham Dumpleton.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Sep 16, 2007
1 parent 68884a5 commit 1ef4f5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions django/core/handlers/modpython.py
Expand Up @@ -42,8 +42,11 @@ def get_full_path(self):
return '%s%s' % (self.path, self._req.args and ('?' + self._req.args) or '')

def is_secure(self):
# Note: modpython 3.2.10+ has req.is_https(), but we need to support previous versions
return 'HTTPS' in self._req.subprocess_env and self._req.subprocess_env['HTTPS'] == 'on'
try:
return self._req.is_https()
except AttributeError:
# mod_python < 3.2.10 doesn't have req.is_https().
return self._req.subprocess_env.get('HTTPS', '').lower() in ('on', '1')

def _load_post_and_files(self):
"Populates self._post and self._files"
Expand Down

0 comments on commit 1ef4f5e

Please sign in to comment.