class XFrameOptionsMiddleware(MiddlewareMixin):
Set the X-Frame-Options HTTP header in HTTP responses.
Do not set the header if it's already set or if the response contains a xframe_options_exempt value set to True.
By default, set the X-Frame-Options header to 'SAMEORIGIN', meaning the response can only be loaded on a frame within the same site. To prevent the response from being loaded in a frame in any site, set X_FRAME_OPTIONS in your project's Django settings to 'DENY'.
Method | get_xframe_options_value |
Get the value to set for the X_FRAME_OPTIONS header. Use the value from the X_FRAME_OPTIONS setting, or 'DENY' if not set. |
Method | process_response |
Undocumented |
Inherited from MiddlewareMixin
:
Async Method | __acall__ |
Async version of __call__ that is swapped in when an async request is running. |
Method | __call__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | _async_check |
If get_response is a coroutine function, turns us into async mode so a thread is not consumed during a whole request. |
Class Variable | async_capable |
Undocumented |
Class Variable | sync_capable |
Undocumented |
Instance Variable | _is_coroutine |
Undocumented |
Instance Variable | get_response |
Undocumented |