o
    i                     @   sT   d dl mZ d dl mZ d dlmZ d dlmZ G dd deZG dd deZd	S )
   )dump_header)parse_set_header)environ_property)header_propertyc                   @   s6   e Zd ZdZedddZededdZedd	dZd
S )CORSRequestMixinzA mixin for :class:`~werkzeug.wrappers.BaseRequest` subclasses
    that adds descriptors for Cross Origin Resource Sharing (CORS)
    headers.

    .. versionadded:: 1.0
    HTTP_ORIGINzThe host that the request originated from. Set :attr:`~CORSResponseMixin.access_control_allow_origin` on the response to indicate which origins are allowed.doc#HTTP_ACCESS_CONTROL_REQUEST_HEADERSzSent with a preflight request to indicate which headers will be sent with the cross origin request. Set :attr:`~CORSResponseMixin.access_control_allow_headers` on the response to indicate which headers are allowed.)	load_funcr	   "HTTP_ACCESS_CONTROL_REQUEST_METHODzSent with a preflight request to indicate which method will be used for the cross origin request. Set :attr:`~CORSResponseMixin.access_control_allow_methods` on the response to indicate which methods are allowed.N)	__name__
__module____qualname____doc__r   originr   access_control_request_headersaccess_control_request_method r   r   Q/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/werkzeug/wrappers/cors.pyr      s    	
r   c                   @   sv   e Zd ZdZedd Zejdd Zedee	ddZ
edee	d	dZed
ddZedee	ddZedeeddZdS )CORSResponseMixinzA mixin for :class:`~werkzeug.wrappers.BaseResponse` subclasses
    that adds descriptors for Cross Origin Resource Sharing (CORS)
    headers.

    .. versionadded:: 1.0
    c                 C   s
   d| j v S )zWhether credentials can be shared by the browser to
        JavaScript code. As part of the preflight request it indicates
        whether credentials can be used on the cross origin request.
         Access-Control-Allow-Credentials)headers)selfr   r   r    access_control_allow_credentials6   s   
z2CORSResponseMixin.access_control_allow_credentialsc                 C   s(   |du rd| j d< d S | j dd  d S )NTtruer   )r   pop)r   valuer   r   r   r   >   s   zAccess-Control-Allow-Headersz8Which headers can be sent with the cross origin request.)r   	dump_funcr	   zAccess-Control-Allow-Methodsz7Which methods can be used for the cross origin request.zAccess-Control-Allow-OriginzEThe origin or '*' for any origin that may make cross origin requests.r   zAccess-Control-Expose-Headersz>Which headers can be shared by the browser to JavaScript code.zAccess-Control-Max-AgezIThe maximum age in seconds the access control settings can be cached for.N)r   r   r   r   propertyr   setterr   r   r   access_control_allow_headersaccess_control_allow_methodsaccess_control_allow_originaccess_control_expose_headersintstraccess_control_max_ager   r   r   r   r   .   sD    


r   N)	httpr   r   utilsr   r   objectr   r   r   r   r   r   <module>   s    '