ó
i4Vdc           @   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.

    https://en.wikipedia.org/wiki/Clickjacking#Server_and_client
    c         C   sI   | j  d  d  k	 r | St | d t  r/ | S|  j | |  | d <| S(   Ns   X-Frame-Optionst   xframe_options_exempt(   t   gett   Nonet   getattrt   Falset   get_xframe_options_value(   t   selft   requestt   response(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/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
   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/middleware/clickjacking.pyR   *   s    
(   t   __name__t
   __module__t   __doc__R   R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/middleware/clickjacking.pyR      s   	N(   R   t   django.confR    t   objectR   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/middleware/clickjacking.pyt   <module>   s   