o
    bZh                      @  s   d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d d	lmZ eed
ZdddZdddZdS )    )annotationsN)Sequence)Any)urlsplit)settings)CheckMessage)Error)conf kwargsr   returnlist[CheckMessage]c            	   
   K  sf  g }t tjts|tddd t tjts |tddd ttjt	s/|tddd ttj
t	s>|tdd	d ttjtrItjd
k rR|tddd ttjt	snttdr`d}nd}|t| ddd ttdrvd}nd}t tjts|t| ddd nHd}tjD ]B}||v rqt|}|jdks|jdkr|tdt||ddd qdD ]}t||dkr|tdt|||dd qqttdrd}nd}t tjttfs|td |d!d t tjts|td"d#d ttjttfs|td$d%d ttd&r"|td'd(d ttd)r1|td*dd |S )+Nz3CORS_ALLOW_HEADERS should be a sequence of strings.zcorsheaders.E001)idz3CORS_ALLOW_METHODS should be a sequence of strings.zcorsheaders.E002z(CORS_ALLOW_CREDENTIALS should be a bool.zcorsheaders.E003z,CORS_ALLOW_PRIVATE_NETWORK should be a bool.zcorsheaders.E015r   zJCORS_PREFLIGHT_MAX_AGE should be an integer greater than or equal to zero.zcorsheaders.E004CORS_ALLOW_ALL_ORIGINSZCORS_ORIGIN_ALLOW_ALLz should be a bool.zcorsheaders.E005CORS_ALLOWED_ORIGINSZCORS_ORIGIN_WHITELISTz! should be a sequence of strings.zcorsheaders.E006)nullzfile://r
   z+Origin {} in {} is missing scheme or netloczcorsheaders.E013z:Add a scheme (e.g. https://) or netloc (e.g. example.com).)r   hint)pathqueryfragmentz"Origin {} in {} should not have {}zcorsheaders.E014CORS_ALLOWED_ORIGIN_REGEXESZCORS_ORIGIN_REGEX_WHITELISTz;{} should be a sequence of strings and/or compiled regexes.zcorsheaders.E007z)CORS_EXPOSE_HEADERS should be a sequence.zcorsheaders.E008z,CORS_URLS_REGEX should be a string or regex.zcorsheaders.E009Z
CORS_MODELzKThe CORS_MODEL setting has been removed - see django-cors-headers' HISTORY.zcorsheaders.E012ZCORS_REPLACE_HTTPS_REFERERz]The CORS_REPLACE_HTTPS_REFERER setting has been removed - see django-cors-headers' CHANGELOG.)is_sequencer	   ZCORS_ALLOW_HEADERSstrappendr   ZCORS_ALLOW_METHODS
isinstanceZCORS_ALLOW_CREDENTIALSboolZCORS_ALLOW_PRIVATE_NETWORKZCORS_PREFLIGHT_MAX_AGEintr   hasattrr   r   r   schemenetlocformatreprgetattrr   re_typeZCORS_EXPOSE_HEADERSZCORS_URLS_REGEX)	r   errorsZallow_all_aliasZallowed_origins_aliasZspecial_origin_valuesoriginparsedpartZallowed_regexes_alias r(   I/var/www/html/lang_env/lib/python3.10/site-packages/corsheaders/checks.pycheck_settings   s   








	



r*   thingtype_or_types!type[Any] | tuple[type[Any], ...]r   c                   s    t | tot fdd| D S )Nc                 3  s    | ]}t | V  qd S )N)r   ).0xr,   r(   r)   	<genexpr>   s    

zis_sequence.<locals>.<genexpr>)r   r   all)r+   r,   r(   r0   r)   r      s   r   )r   r   r   r   )r+   r   r,   r-   r   r   )
__future__r   recollections.abcr   typingr   urllib.parser   Zdjango.confr   Zdjango.core.checksr   r   Zcorsheaders.confr	   typecompiler#   r*   r   r(   r(   r(   r)   <module>   s    
 