|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /usr/lib64/python2.7/site-packages/django/middleware/ |
Upload File : |
�
r�\c @ s0 d Z d d l m Z d e f d � � YZ d S( s�
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
i����( t settingst XFrameOptionsMiddlewarec B s e Z d Z d � Z d � Z RS( s�
Middleware that sets the X-Frame-Options HTTP header in HTTP responses.
Does not set the header if it's already set or if the response contains
a xframe_options_exempt value set to True.
By default, sets 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'.
Note: older browsers will quietly ignore this header, thus other
clickjacking protection techniques should be used if protection in those
browsers is required.
http://en.wikipedia.org/wiki/Clickjacking#Server_and_client
c C sL | j d d � d k r | St | d t � r2 | S| j | | � | d <| S( Ns X-Frame-Optionst xframe_options_exempt( t gett Nonet getattrt Falset get_xframe_options_value( t selft requestt response( ( s@ /tmp/pip-install-XxeQeY/django/django/middleware/clickjacking.pyt process_response s
c C s t t d d � j � S( sE
Gets the value to set for the X_FRAME_OPTIONS header.
By default this uses the value from the X_FRAME_OPTIONS Django
settings. If not found in settings, defaults to 'SAMEORIGIN'.
This method can be overridden if needed, allowing it to vary based on
the request or response.
t X_FRAME_OPTIONSt
SAMEORIGIN( R R t upper( R R R
( ( s@ /tmp/pip-install-XxeQeY/django/django/middleware/clickjacking.pyR ) s
( t __name__t
__module__t __doc__R R ( ( ( s@ /tmp/pip-install-XxeQeY/django/django/middleware/clickjacking.pyR
s
N( R t django.confR t objectR ( ( ( s@ /tmp/pip-install-XxeQeY/django/django/middleware/clickjacking.pyt <module> s