Skip to content

Commit

Permalink
Fix report_only to REPORT_ONLY in decorator docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson authored and stevejalim committed Jun 7, 2024
1 parent 29c175c commit 193c0f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,18 @@ decorators now accept a dictionary containing the CSP directives as an argument.
@csp_update({"default-src": ["another-url.com"]})
def my_view(request): ...
Additionally, each decorator now takes an optional ``report_only`` argument to specify whether the
Additionally, each decorator now takes an optional ``REPORT_ONLY`` argument to specify whether the
policy should be enforced or only report violations. For example:

.. code-block:: python
from csp.decorators import csp
@csp({"default-src": ["'self'"]}, report_only=True)
@csp({"default-src": ["'self'"]}, REPORT_ONLY=True)
def my_view(request): ...
Due to the addition of the ``report_only`` argument and for consistency, the ``csp_exempt``
Due to the addition of the ``REPORT_ONLY`` argument and for consistency, the ``csp_exempt``
decorator now requires parentheses when used with and without arguments. For example:

.. code-block:: python
Expand All @@ -157,7 +157,7 @@ decorator now requires parentheses when used with and without arguments. For exa
@csp_exempt()
@csp_exempt(report_only=True)
@csp_exempt(REPORT_ONLY=True)
def my_view(request): ...
Look for uses of the following decorators in your code: ``@csp``, ``@csp_update``, ``@csp_replace``,
Expand Down

0 comments on commit 193c0f5

Please sign in to comment.