HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib/python3.10/site-packages/urllib3/util/__pycache__/request.cpython-310.pyc
o

<i� �@s�UddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZejr0dd	lm
Z
d
Zegd��ZdZzzddlZWn
eyNddlZYnwWn	eyYYnwed
7ZzddlmZed7ZWney�z
ddlZed7ZWn	ey�YnwYnwGdd�de�ZejZded<ejeefZ hd�Z!						d7d8d d!�Z"d9d&d'�Z#d:d,d-�Z$Gd.d/�d/ej%�Z&d;d5d6�Z'dS)<�)�annotationsN)�	b64encode)�Enum�)�UnrewindableBodyError�)�to_bytes)�Finalz@@@SKIP_HEADER@@@)�accept-encoding�host�
user-agentzgzip,deflatez,br)�zstdz,zstdc@seZdZdZdS)�_TYPE_FAILEDTELLrN)�__name__�
__module__�__qualname__�token�rr�B/opt/osm/venv/lib/python3.10/site-packages/urllib3/util/request.pyr/srzFinal[_TYPE_FAILEDTELL]�_FAILEDTELL>�DELETEZCONNECT�TRACE�OPTIONS�GET�HEAD�
keep_alive�bool | None�accept_encoding�bool | list[str] | str | None�
user_agent�
str | None�
basic_auth�proxy_basic_auth�
disable_cache�return�dict[str, str]cCs�i}|rt|t�r
n
t|t�rd�|�}nt}||d<|r!||d<|r'd|d<|r7dt|�d������|d<|rGdt|�d������|d	<|rMd
|d<|S)ad
    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 ``zstandard`` package) 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.

    :param proxy_basic_auth:
        Colon-separated username:password string for 'proxy-authorization: basic ...'
        auth header.

    :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'}
    �,r
rz
keep-alive�
connectionzBasic zlatin-1�
authorizationzproxy-authorizationzno-cachez
cache-control)�
isinstance�str�list�join�ACCEPT_ENCODINGr�encode�decode)rrrr!r"r#�headersrrr�make_headers?s*1

��r1�body�
typing.Any�pos�_TYPE_BODY_POSITION | NonecCsR|durt||�|St|dd�dur'z|��}W|Sty&t}Y|Sw|S)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�getattrr6�OSErrorr)r2r4rrr�set_file_position�s
	�
��r:�typing.IO[typing.AnyStr]�body_pos�_TYPE_BODY_POSITION�Nonec
Cstt|dd�}|dur(t|t�r(z||�WdSty'}ztd�|�d}~ww|tur0td��tdt|��d���)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.z1body_pos must be of type integer, instead it was �.)r8r)�intr9rr�
ValueError�type)r2r<�	body_seek�errrr7�s&������r7c@seZdZUded<ded<dS)�ChunksAndContentLengthztyping.Iterable[bytes] | None�chunksz
int | None�content_lengthN)rrr�__annotations__rrrrrF�s
rF�typing.Any | None�methodr*�	blocksizerAcs��durd}|��tvrd}nWd}nTt�ttf�r%t��f}t|d�}nAt�d�r8d
��fdd�}|�}d}n.zt��}Wn!t	y_zt
��}d}Wnt	y\t	d����d�wYnw�f}|j}t||d	�S)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�readr$�typing.Iterable[bytes]c3s8�t�tj�}	����}|sdS|r|�d�}|Vq)NTzutf-8)r)�io�
TextIOBaserMr.)r.�	datablock�rLr2rr�chunk_readable�s�

�z&body_to_chunks.<locals>.chunk_readablezO'body' must be a bytes-like object, file-like object, or iterable. Instead was )rGrH)r$rN)
�upper�_METHODS_NOT_EXPECTING_BODYr)r*�bytesr�len�hasattr�
memoryview�	TypeError�iter�nbytesrF)r2rKrLrGrHrS�mvrrRr�body_to_chunks�s@

������r^)NNNNNN)rrrrrr r!r r"r r#rr$r%)r2r3r4r5r$r5)r2r;r<r=r$r>)r2rJrKr*rLrAr$rF)(�
__future__rrO�typing�base64r�enumr�
exceptionsr�utilr�
TYPE_CHECKINGr	�SKIP_HEADER�	frozenset�SKIPPABLE_HEADERSr-Z
brotlicffiZ_unused_module_brotli�ImportError�brotli�compressionr
Z_unused_module_zstdZ	zstandardrrrrI�UnionrAr=rUr1r:r7�
NamedTuplerFr^rrrr�<module>sd������	�
Q