mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #33569 -- Added SECURE_PROXY_SSL_HEADER support for list of protocols in the header value.
This commit is contained in:
committed by
Mariusz Felisiak
parent
d46e158ee2
commit
1cf60ce601
@@ -2442,8 +2442,17 @@ required value. For example::
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
|
||||
This tells Django to trust the ``X-Forwarded-Proto`` header that comes from our
|
||||
proxy, and any time its value is ``'https'``, then the request is guaranteed to
|
||||
be secure (i.e., it originally came in via HTTPS).
|
||||
proxy and that the request is guaranteed to be secure (i.e., it originally came
|
||||
in via HTTPS) when:
|
||||
|
||||
* the header value is ``'https'``, or
|
||||
* its initial, leftmost value is ``'https'`` in the case of a comma-separated
|
||||
list of protocols (e.g. ``'https,http,http'``).
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for a comma-separated list of protocols in the header value was
|
||||
added.
|
||||
|
||||
You should *only* set this setting if you control your proxy or have some other
|
||||
guarantee that it sets/strips this header appropriately.
|
||||
@@ -2463,8 +2472,9 @@ available in ``request.META``.)
|
||||
|
||||
* Your Django app is behind a proxy.
|
||||
* Your proxy strips the ``X-Forwarded-Proto`` header from all incoming
|
||||
requests. In other words, if end users include that header in their
|
||||
requests, the proxy will discard it.
|
||||
requests, even when it contains a comma-separated list of protocols. In
|
||||
other words, if end users include that header in their requests, the
|
||||
proxy will discard it.
|
||||
* Your proxy sets the ``X-Forwarded-Proto`` header and sends it to Django,
|
||||
but only for requests that originally come in via HTTPS.
|
||||
|
||||
|
||||
@@ -293,6 +293,9 @@ Security
|
||||
* The new :setting:`SECRET_KEY_FALLBACKS` setting allows providing a list of
|
||||
values for secret key rotation.
|
||||
|
||||
* The :setting:`SECURE_PROXY_SSL_HEADER` setting now supports a comma-separated
|
||||
list of protocols in the header value.
|
||||
|
||||
Serialization
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user