summaryrefslogtreecommitdiff
path: root/django/views/decorators/clickjacking.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2022-05-22 08:26:21 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-05-25 10:58:48 +0200
commit8cf4de206ce4e1fe1e06a55a30c4e6bebe7cf10a (patch)
treef9abbdabd7e7da2f237092458b51d4407607e86c /django/views/decorators/clickjacking.py
parentaff649a3bd0c4fd8f7d859464f0eb907e877443f (diff)
Normalized decorator style for functools.wraps.
Diffstat (limited to 'django/views/decorators/clickjacking.py')
-rw-r--r--django/views/decorators/clickjacking.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/django/views/decorators/clickjacking.py b/django/views/decorators/clickjacking.py
index 005d942c76..8fa49ddb80 100644
--- a/django/views/decorators/clickjacking.py
+++ b/django/views/decorators/clickjacking.py
@@ -12,13 +12,14 @@ def xframe_options_deny(view_func):
...
"""
+ @wraps(view_func)
def wrapper_view(*args, **kwargs):
resp = view_func(*args, **kwargs)
if resp.get("X-Frame-Options") is None:
resp["X-Frame-Options"] = "DENY"
return resp
- return wraps(view_func)(wrapper_view)
+ return wrapper_view
def xframe_options_sameorigin(view_func):
@@ -32,13 +33,14 @@ def xframe_options_sameorigin(view_func):
...
"""
+ @wraps(view_func)
def wrapper_view(*args, **kwargs):
resp = view_func(*args, **kwargs)
if resp.get("X-Frame-Options") is None:
resp["X-Frame-Options"] = "SAMEORIGIN"
return resp
- return wraps(view_func)(wrapper_view)
+ return wrapper_view
def xframe_options_exempt(view_func):
@@ -51,9 +53,10 @@ def xframe_options_exempt(view_func):
...
"""
+ @wraps(view_func)
def wrapper_view(*args, **kwargs):
resp = view_func(*args, **kwargs)
resp.xframe_options_exempt = True
return resp
- return wraps(view_func)(wrapper_view)
+ return wrapper_view