django1/django/middleware
Unai Zalakain c7634cd7fe Fixed #7603 -- Added a 'scheme' property to the HttpRequest object
`HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is
appropriately set and falls back to `HttpRequest._get_scheme()` (a hook
for subclasses to implement) otherwise.

`WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI
environ variable to determine the request scheme.

`HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is
`https`.

This provides a way to check the current scheme in templates, for example.
It also allows us to deal with other schemes.

Thanks nslater for the suggestion.
2013-10-15 09:04:12 -04:00
..
__init__.py Imported Django from private SVN repository (created from r. 8825) 2005-07-13 01:25:57 +00:00
cache.py Used "is" for comparisons with None. 2013-10-10 09:35:56 -04:00
clickjacking.py Fixed #14261 - Added clickjacking protection (X-Frame-Options header) 2011-05-30 22:27:47 +00:00
common.py Fixed #7603 -- Added a 'scheme' property to the HttpRequest object 2013-10-15 09:04:12 -04:00
csrf.py Removed several unused imports. 2013-06-19 17:18:40 +02:00
doc.py Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00
gzip.py Fixed #7581 -- Added streaming responses. 2012-10-20 20:05:11 +02:00
http.py Fixed #7581 -- Added streaming responses. 2012-10-20 20:05:11 +02:00
locale.py Fixed #7603 -- Added a 'scheme' property to the HttpRequest object 2013-10-15 09:04:12 -04:00
transaction.py Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00