
    h                     6    d Z ddlmZ ddlmZ  G d de      Zy)z
Clickjacking Protection Middleware.

This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
    )settings)MiddlewareMixinc                       e Zd ZdZd Zd Zy)XFrameOptionsMiddlewarea  
    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'.
    c                 t    |j                  d      |S t        |dd      r|S | j                  ||      |d<   |S )NzX-Frame-Optionsxframe_options_exemptF)getgetattrget_xframe_options_valueselfrequestresponses      a/var/www/html/ranktracker/api/venv/lib/python3.12/site-packages/django/middleware/clickjacking.pyprocess_responsez(XFrameOptionsMiddleware.process_response   sL    <<)*6O 84e<O&*&C&CGDL'N"#    c                 @    t        t        dd      j                         S )a  
        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.
        X_FRAME_OPTIONSDENY)r
   r   upperr   s      r   r   z0XFrameOptionsMiddleware.get_xframe_options_value%   s     x!2F;AACCr   N)__name__
__module____qualname____doc__r   r    r   r   r   r      s    
Dr   r   N)r   django.confr   django.utils.deprecationr   r   r   r   r   <module>r      s     ! 4!Do !Dr   