diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2006-07-21 16:20:22 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2006-07-21 16:20:22 +0000 |
| commit | e9a236d86c82133ab1959e4ea4760ebe6f73bd8e (patch) | |
| tree | 3a8f05df528fc6b5c853cb66c3718d6c33af7654 /django/http | |
| parent | 8bdd19beea3002d8b99cbaaab9624dca8f7a8694 (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/http')
| -rw-r--r-- | django/http/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index 8fb4b293fc..06f6a106ee 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -1,3 +1,4 @@ +import os from Cookie import SimpleCookie from pprint import pformat from urllib import urlencode, quote @@ -37,6 +38,9 @@ class HttpRequest(object): def get_full_path(self): return '' + + def is_secure(self): + return os.environ.get("HTTPS") == "on" def parse_file_upload(header_dict, post_data): "Returns a tuple of (POST MultiValueDict, FILES MultiValueDict)" |
