%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/certbot/5911/lib64/python3.12/site-packages/urllib3/util/__pycache__/
Upload File :
Create Path :
Current File : //snap/certbot/5911/lib64/python3.12/site-packages/urllib3/util/__pycache__/request.cpython-312.pyc

�

�h�j�'��>�UddlmZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZejrdd	lmZd
Zegd��ZdZ		ddlZed
z
Z	ej.dk\rddlmZnddlmZedz
ZGd�de�Zej:Zded<ej@e!efZ"hd�Z#						dddd�																	dd�Z$						d d�Z%d!d�Z&Gd�dejN�Z(								d"d�Z)y#e$rddlZY��wxYw#e$rY��wxYw#e$rY��wxYw)#�)�annotationsN)�	b64encode)�Enum�)�UnrewindableBodyError�)�to_bytes)�Finalz@@@SKIP_HEADER@@@)�accept-encoding�host�
user-agentzgzip,deflatez,br)��)�zstdz,zstdc��eZdZdZy)�_TYPE_FAILEDTELLrN)�__name__�
__module__�__qualname__�token���P/root/parts/certbot/install/lib/python3.12/site-packages/urllib3/util/request.pyrr,s��
�ErrzFinal[_TYPE_FAILEDTELL]�_FAILEDTELL>�GET�HEAD�TRACE�DELETE�CONNECT�OPTIONSzlatin-1)�basic_auth_encoding�proxy_basic_auth_encodingc�t�i}|r>t|t�rn(t|t�rdj|�}nt}||d<|r||d<|rd|d<|r.dt|j
|��j���|d<|r.dt|j
|��j���|d<|rd	|d
<|S)a�
    Shortcuts for generating request headers.

    :param keep_alive:
        If ``True``, adds 'connection: keep-alive' header.

    :param accept_encoding:
        Can be a boolean, list, or string.
        ``True`` translates to 'gzip,deflate'.  If the dependencies for
        Brotli (either the ``brotli`` or ``brotlicffi`` package) and/or
        Zstandard (the ``backports.zstd`` package for Python before 3.14)
        algorithms are installed, then their encodings are
        included in the string ('br' and 'zstd', respectively).
        List will get joined by comma.
        String will be used as provided.

    :param user_agent:
        String representing the user-agent you want, such as
        "python-urllib3/0.6"

    :param basic_auth:
        Colon-separated username:password string for 'authorization: basic ...'
        auth header. Basic authentication transmits Base64-encoded bytes, not
        Unicode text, so the string is encoded with ``basic_auth_encoding``
        before Base64 encoding.

        Must contain decoded credentials (not percent-encoded).
        For URLs parsed with :func:`parse_url`, use :attr:`Url.auth_decoded_joined`
        to get the properly formatted string.

    :param basic_auth_encoding:
        Text encoding used to encode ``basic_auth`` before Base64 encoding.
        Defaults to "latin-1" for backward compatibility. Use "utf-8" only
        when the peer expects UTF-8 Basic authentication credentials.

        Must contain decoded credentials (not percent-encoded).
        For URLs parsed with :func:`parse_url`, use :attr:`Url.auth_decoded_joined`
        to get the properly formatted string.

    :param proxy_basic_auth:
        Colon-separated username:password string for 'proxy-authorization: basic ...'
        auth header. Basic authentication transmits Base64-encoded bytes, not
        Unicode text, so the string is encoded with ``proxy_basic_auth_encoding``
        before Base64 encoding.

        Must contain decoded credentials (not percent-encoded).
        For URLs parsed with :func:`parse_url`, use :attr:`Url.auth_decoded_joined`
        to get the properly formatted string.

    :param proxy_basic_auth_encoding:
        Text encoding used to encode ``proxy_basic_auth`` before Base64
        encoding. Defaults to "latin-1" for backward compatibility. Use
        "utf-8" only when the proxy expects UTF-8 Basic authentication
        credentials.

        Must contain decoded credentials (not percent-encoded).
        For URLs parsed with :func:`parse_url`, use :attr:`Url.auth_decoded_joined`
        to get the properly formatted string.

    :param disable_cache:
        If ``True``, adds 'cache-control: no-cache' header.

    Example:

    .. code-block:: python

        import urllib3

        print(urllib3.util.make_headers(keep_alive=True, user_agent="Batman/1.0"))
        # {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
        print(urllib3.util.make_headers(accept_encoding=True))
        # {'accept-encoding': 'gzip,deflate'}
    �,rr
z
keep-alive�
connectionzBasic �
authorizationzproxy-authorizationzno-cachez
cache-control)�
isinstance�str�list�join�ACCEPT_ENCODINGr�encode�decode)	�
keep_alive�accept_encoding�
user_agent�
basic_auth�proxy_basic_auth�
disable_cacher!r"�headerss	         r�make_headersr5<s���h!�G���o�s�+��
���
.�!�h�h��7�O�-�O�%4��!�"�� *����� ,������Y�z�0�0�1D�E�F�M�M�O�P�Q�	�� ���Y�/�6�6�7P�Q�R�Y�Y�[�\�]�	�%�&��#-��� ��Nrc��|�t||�|St|dd��	|j�}|S|S#t$r
t}Y|SwxYw)z
    If a position is provided, move file to that point.
    Otherwise, we'll attempt to record a position for future use.
    N�tell)�rewind_body�getattrr7�OSErrorr)�body�poss  r�set_file_positionr=�sc�����D�#���J�
��v�t�	$�	0�	��)�)�+�C��J�3�J���	��C��J�	�s�3�A�Ac��t|dd�}|�t|t�r
	||�y|t
urt	d��|�t	d��t
dt|��d���#t$r}t	d�|�d}~wwxYw)z�
    Attempt to rewind body to a certain position.
    Primarily used for request redirects and retries.

    :param body:
        File-like object that supports seek.

    :param int pos:
        Position to seek to in file.
    �seekNzAAn error occurred when rewinding request body for redirect/retry.zRUnable to record file position for rewinding request body during a redirect/retry.zbody does not implement seek.z1body_pos must be of type integer, instead it was �.)r9r'�intr:rr�
ValueError�type)r;�body_pos�	body_seek�es    rr8r8�s�����f�d�+�I����H�c�!:�	��h��

�[�	 �#�
4�
�	
�
�	�#�$C�D�D��?��X��?O�q�Q�
�	
���	�'�S���
��	�s�A"�"	A<�+A7�7A<c�"�eZdZUded<ded<y)�ChunksAndContentLengthztyping.Iterable[bytes] | None�chunksz
int | None�content_lengthN)rrr�__annotations__rrrrHrH�s��)�)��rrHc������d}|j�tvrd}nld}nit�ttf�rt��f}t
|d�}n8t�d�rd��fd�}|�}d}n	t��}�f}|j}t||��S#t$r.	t��}d}n#t$rtd����d�wxYwY�CwxYw)aRTakes the HTTP request method, body, and blocksize and
    transforms them into an iterable of chunks to pass to
    socket.sendall() and an optional 'Content-Length' header.

    A 'Content-Length' of 'None' indicates the length of the body
    can't be determined so should use 'Transfer-Encoding: chunked'
    for framing instead.
    Nr�readc3��K�t�tj�}	�j��}|sy|r|j	d�}|���,�w)Nzutf-8)r'�io�
TextIOBaserMr,)r,�	datablock�	blocksizer;s  ��r�chunk_readablez&body_to_chunks.<locals>.chunk_readable
sK�������b�m�m�4�F�� �I�I�i�0�	� ��� )� 0� 0�� 9�I���
�s�AAzO'body' must be a bytes-like object, file-like object, or iterable. Instead was )rIrJ)�returnztyping.Iterable[bytes])
�upper�_METHODS_NOT_EXPECTING_BODYr'r(�bytesr	�len�hasattr�
memoryview�nbytes�	TypeError�iterrH)r;�methodrRrIrJrS�mvs` `    r�body_to_chunksr`�s����$�|����<�<�>�!<�<��N�!�N�
�D�3��,�	'��4�.�"���V�A�Y���
��v�	�	 � �!����	'��D�!�B��W�F��Y�Y�N�!���O�O���		�
��d���!%����
��8�8<�x�A����
���			�s*�2B�	C�#
B1�0C�1C
�
C�C)NNNNNN)r.�bool | Noner/zbool | list[str] | str | Noner0�
str | Noner1rbr2rbr3rar!r(r"r(rTzdict[str, str])r;z
typing.Anyr<�_TYPE_BODY_POSITION | NonerTrc)r;ztyping.IO[typing.AnyStr]rD�_TYPE_BODY_POSITIONrT�None)r;ztyping.Any | Noner^r(rRrArTrH)*�
__future__rrO�sys�typing�base64r�enumr�
exceptionsr�utilr	�
TYPE_CHECKINGr
�SKIP_HEADER�	frozenset�SKIPPABLE_HEADERSr+�
brotlicffi�_unused_module_brotli�ImportError�brotli�version_info�compressionr�_unused_module_zstd�	backportsrrrrK�UnionrArdrVr5r=r8�
NamedTuplerHr`rrr�<module>r{s���"�	�
�
���.��	����"���G�H�� ���/�2��u��O��
���7�"�;�9��w��O��t��(8�'=�'=��
$�=��l�l�3�(8�#8�9��W��#�59�!�!�#'�!%�
q� )�%.�q��q�2�q��q��	q�
!�q��
q��q� #�q��q�h�
��5����(
�@�V�.�.��
BP�
�BP�%(�BP�58�BP��BP��_�/�.�/���	��	���	��	�s<�C:�D�:	D�D	�D�D	�	D�D�D�D

Zerion Mini Shell 1.0
GEPRES Tracking

República de Moçambique

Ministério da Economia e Finanças