MCPcopy
hub / github.com/django/django / scheme

Method scheme

django/http/request.py:314–327  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

312
313 @property
314 def scheme(self):
315 if settings.SECURE_PROXY_SSL_HEADER:
316 try:
317 header, secure_value = settings.SECURE_PROXY_SSL_HEADER
318 except ValueError:
319 raise ImproperlyConfigured(
320 "The SECURE_PROXY_SSL_HEADER setting must be a tuple containing "
321 "two values."
322 )
323 header_value = self.META.get(header)
324 if header_value is not None:
325 header_value, *_ = header_value.split(",", 1)
326 return "https" if header_value.strip() == secure_value else "http"
327 return self._get_scheme()
328
329 def is_secure(self):
330 return self.scheme == "https"

Callers

nothing calls this directly

Calls 4

_get_schemeMethod · 0.95
getMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected