mirror of
https://github.com/django/django.git
synced 2025-07-07 11:19:12 +00:00
[4.0.x] Corrected CSRF reference in middleware docs.
Backport of 8e633906403853868bcd7df62ba30a86151a944d from main
This commit is contained in:
parent
b8f7c84922
commit
de5a453d51
@ -302,10 +302,11 @@ for:
|
||||
|
||||
.. warning::
|
||||
When your site is served via HTTPS, :ref:`Django's CSRF protection system
|
||||
<using-csrf>` requires the ``Referer`` header to be present, so completely
|
||||
disabling the ``Referer`` header will interfere with CSRF protection. To
|
||||
gain most of the benefits of disabling ``Referer`` headers while also
|
||||
keeping CSRF protection, consider enabling only same-origin referrers.
|
||||
<how-csrf-works>` requires the ``Referer`` header to be present, so
|
||||
completely disabling the ``Referer`` header will interfere with CSRF
|
||||
protection. To gain most of the benefits of disabling ``Referer`` headers
|
||||
while also keeping CSRF protection, consider enabling only same-origin
|
||||
referrers.
|
||||
|
||||
``SecurityMiddleware`` can set the ``Referrer-Policy`` header for you, based on
|
||||
the :setting:`SECURE_REFERRER_POLICY` setting (note spelling: browsers send a
|
||||
|
Loading…
x
Reference in New Issue
Block a user