class documentation

class XFrameOptionsMiddleware(MiddlewareMixin): (source)

View In Hierarchy

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 'DENY', meaning the response cannot be displayed in a frame, regardless of the site attempting to do so. To enable the response to be loaded on a frame within the same site, set X_FRAME_OPTIONS in your project's Django settings to 'SAMEORIGIN'.

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
Class Variable async_capable Undocumented
Class Variable sync_capable Undocumented
Instance Variable get_response 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.
Instance Variable _is_coroutine Undocumented
def get_xframe_options_value(self, request, response): (source)

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. This method can be overridden if needed, allowing it to vary based on the request or response.

def process_response(self, request, response): (source)

Undocumented