
    g                     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 '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'.
    c                     |j                  d      |S t        |dd      r|S | j                  ||      |j                  d<   |S )NzX-Frame-Optionsxframe_options_exemptF)getgetattrget_xframe_options_valueheadersselfrequestresponses      v/var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/middleware/clickjacking.pyprocess_responsez(XFrameOptionsMiddleware.process_response   sT    <<)*6O 84e<O.2.K.K/
*+     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   