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/views/debug.py | |
| 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/views/debug.py')
| -rw-r--r-- | django/views/debug.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/views/debug.py b/django/views/debug.py index 6cbbde987b..ffcb284a86 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -124,7 +124,7 @@ def technical_500_response(request, exc_type, exc_value, tb): 'frames': frames, 'lastframe': frames[-1], 'request': request, - 'request_protocol': os.environ.get("HTTPS") == "on" and "https" or "http", + 'request_protocol': request.is_secure() and "https" or "http", 'settings': get_safe_settings(), 'template_info': template_info, 'template_does_not_exist': template_does_not_exist, @@ -149,7 +149,7 @@ def technical_404_response(request, exception): 'urlpatterns': tried, 'reason': str(exception), 'request': request, - 'request_protocol': os.environ.get("HTTPS") == "on" and "https" or "http", + 'request_protocol': request.is_secure() and "https" or "http", 'settings': get_safe_settings(), }) return HttpResponseNotFound(t.render(c), mimetype='text/html') |
