summaryrefslogtreecommitdiff
path: root/django/http/request.py
diff options
context:
space:
mode:
authorRik <gitaarik@gmail.com>2015-03-10 17:22:55 +0100
committerTim Graham <timograham@gmail.com>2015-03-11 14:35:25 -0400
commitccff08c194b0b7f8a86bf9c5dd6d5be473760a1b (patch)
tree08b9b259e87418a68c940b5c7aa18ce36393c25c /django/http/request.py
parenta3e89f13dfb1f22a26ead8b06b37695598a4421a (diff)
downloaddjango-ccff08c194b0b7f8a86bf9c5dd6d5be473760a1b.tar.gz
Fixed #24463 -- Removed mod_python functionality from HttpRequest._get_scheme()
Diffstat (limited to 'django/http/request.py')
-rw-r--r--django/http/request.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/http/request.py b/django/http/request.py
index 398cf20dfb..7989d064b6 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -1,7 +1,6 @@
from __future__ import unicode_literals
import copy
-import os
import re
import sys
from io import BytesIO
@@ -157,11 +156,14 @@ class HttpRequest(object):
return iri_to_uri(location)
def _get_scheme(self):
- return 'https' if os.environ.get("HTTPS") == "on" else 'http'
+ """
+ Hook for subclasses like WSGIRequest to implement. Returns 'http' by
+ default.
+ """
+ return 'http'
@property
def scheme(self):
- # First, check the SECURE_PROXY_SSL_HEADER setting.
if settings.SECURE_PROXY_SSL_HEADER:
try:
header, value = settings.SECURE_PROXY_SSL_HEADER
@@ -171,8 +173,6 @@ class HttpRequest(object):
)
if self.META.get(header, None) == value:
return 'https'
- # Failing that, fall back to _get_scheme(), which is a hook for
- # subclasses to implement.
return self._get_scheme()
def is_secure(self):