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: //usr/local/lib/python3.7/site-packages/urllib3/util/__pycache__/url.cpython-37.pyc
B

���gm;�@s�ddlmZddlZddlZddlmZddlmZdZe�	d�Z
e�	d	�Ze�	d
ejej
B�ZdZdZd
jeed�Zeed�Zdddddddddg	ZdZdd�dd�eD��dZded Zd!eded"Zd#Ze�	d$�Ze�	d%ed&�Ze�	d%ed&�Ze�	d%ed&�Ze�	d%edd'�d&�Ze�	d(ed)�Z d*eeefZ!e�	e!ejej
B�Z"e#d+�Z$e#d,�Z%e$e%Bd-hBZ&e&d.d/hBZ'e'd0hBZ(Z)Gd1d2�d2e�*d2d3ej+e,fd4ej+e,fd5ej+e,fd6ej+e-fd7ej+e,fd8ej+e,fd9ej+e,fg��Z.ej/d:d;d:d<�d=d>��Z0ej/d?d;d?d<�d@d>��Z0dAd;dAd<�dBd>�Z0d:d:dC�dDdE�Z1ej/d?dAd?dF�dGdH��Z2ej/d:dAd:dF�dIdH��Z2dAdAdAdF�dJdH�Z2d:dKdL�dMdN�Z3d:d:dO�dPdQ�Z4d:d2dR�dSdT�Z5dS)U�)�annotationsN�)�LocationParseError�)�to_str)�http�httpsNz%[a-fA-F0-9]{2}z^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)zS^(?:([a-zA-Z][a-zA-Z0-9+.-]*):)?(?://([^\\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$z(?:[0-9]{1,3}\.){3}[0-9]{1,3}z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))�hexZipv4)r	�ls32z(?:%(hex)s:){6}%(ls32)sz::(?:%(hex)s:){5}%(ls32)sz%(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)sz2(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)sz6(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)sz/(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)sz'(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)sz&(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)sz(?:(?:%(hex)s:){0,6}%(hex)s)?::zCABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~z(?:�|cCsg|]}|t�qS�)�_subs)�.0�xrr�:/usr/local/lib/python3.7/site-packages/urllib3/util/url.py�
<listcomp>4sr�)z
(?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z!(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*z!^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$�^�$����(z)\]$z)^(%s|%s|%s)(?::0*?(|0|[1-9][0-9]{0,4}))?$zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~z!$&'()*+,;=�:�@�/�?c	s�eZdZdZddddddddd��fdd�
Zedd�d	d
��Zedd�dd
��Zedd�dd��Zedd�dd��Z	edd�dd��Z
dd�dd�Z�ZS)�Urlz�
    Data structure for representing an HTTP URL. Used as a return value for
    :func:`parse_url`. Both the scheme and host are normalized as they are
    both case-insensitive according to RFC 3986.
    Nz
str | Nonez
int | None)�scheme�auth�host�port�path�query�fragmentc
s@|r|�d�sd|}|dk	r&|��}t��||||||||�S)Nr)�
startswith�lower�super�__new__)�clsrrrrr r!r")�	__class__rrr&ds

zUrl.__new__)�returncCs|jS)z@For backwards-compatibility with urlparse. We're nice like that.)r)�selfrrr�hostnametszUrl.hostname�strcCs&|jpd}|jdk	r"|d|j7}|S)z)Absolute path including the query string.rNr)r r!)r*�urirrr�request_uriys

zUrl.request_uricCs2|j}|j}|dks|dkr |S|�d|��SdS)z�
        Authority component as defined in RFC 3986 3.2.
        This includes userinfo (auth), host and port.

        i.e.
            userinfo@host:port
        Nr)r�netloc)r*�userinfor/rrr�	authority�s
	z
Url.authoritycCs,|jdkrdS|jr&|j�d|j��S|jS)z�
        Network location including host and port.

        If you need the equivalent of urllib.parse's ``netloc``,
        use the ``authority`` property instead.
        Nr)rr)r*rrrr/�s

z
Url.netlocc	Cs�|\}}}}}}}d}|dk	r*||d7}|dk	r>||d7}|dk	rN||7}|dk	rf|dt|�7}|dk	rv||7}|dk	r�|d|7}|dk	r�|d|7}|S)a2
        Convert self into a url

        This function should more or less round-trip with :func:`.parse_url`. The
        returned url may not be exactly the same as the url inputted to
        :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls
        with a blank port will have : removed).

        Example:

        .. code-block:: python

            import urllib3

            U = urllib3.util.parse_url("https://google.com/mail/")

            print(U.url)
            # "https://google.com/mail/"

            print( urllib3.util.Url("https", "username:password",
                                    "host.com", 80, "/path", "query", "fragment"
                                    ).url
                )
            # "https://username:password@host.com:80/path?query#fragment"
        �Nz://rrr�#)r,)	r*rrrrr r!r"�urlrrrr4�s"zUrl.urlcCs|jS)N)r4)r*rrr�__str__�szUrl.__str__)NNNNNNN)
�__name__�
__module__�__qualname__�__doc__r&�propertyr+r.r1r/r4r5�
__classcell__rr)r(rrPs 
0rrrrrr r!r"r,ztyping.Container[str])�	component�
allowed_charsr)cCsdS)Nr)r<r=rrr�_encode_invalid_chars�sr>�NonecCsdS)Nr)r<r=rrrr>�sz
str | Nonec	Cs�|dkr|St|�}t�dd�|�\}}|�dd�}||�d�k}t�}x�tdt|��D]n}|||d�}t|�}|r�|dks�|d	kr�|�	�|kr�||7}qX|�
dt|�d
d����d
��
��qXW|�	�S)zfPercent-encodes a URI component without reapplying
    onto an already percent-encoded component.
    NcSs|�d���S)Nr)�group�upper)�matchrrr�<lambda>��z'_encode_invalid_chars.<locals>.<lambda>zutf-8�
surrogatepass�%rr�r)r�_PERCENT_RE�subn�encode�count�	bytearray�range�len�ord�decode�extendr	�zfillrA)	r<r=�percent_encodings�	uri_bytes�is_percent_encoded�encoded_component�i�byte�byte_ordrrrr>�s",)r r)cCs�|�d�}g}x6|D].}|dkr"q|dkr6|�|�q|r|��qW|�d�rh|r\|drh|�dd�|�d�r||�d�d�|�S)Nr�.z..rr2)z/.z/..)�split�append�popr#�insert�endswith�join)r �segments�output�segmentrrr�_remove_path_dot_segmentss



rd)rrr)cCsdS)Nr)rrrrr�_normalize_host%srecCsdS)Nr)rrrrrre*scCs�|r�|tkr�t�|�}|r�t�|�}|r�|�d�\}}|||�}|�d�rb|dkrb|dd�}n|dd�}t|t�}|d|��	��d|�||d���S|�	�Sn*t
�|�s�td�dd�|�
d�D��d	�S|S)
Nrz%25��%�.cSsg|]}t|��qSr)�_idna_encode)r�labelrrrrFsz#_normalize_host.<locals>.<listcomp>rZ�ascii)�_NORMALIZABLE_SCHEMES�_IPV6_ADDRZ_RErB�_ZONE_ID_RE�search�spanr#r>�_UNRESERVED_CHARSr$�_IPV4_RErr`r[)rr�is_ipv6rB�start�end�zone_idrrrre/s&


&

�bytes)�namer)cCs�|��sryddl}Wntk
r2td�d�YnXy|j|��ddd�S|jk
rptd|�d��d�YnX|���d�S)Nrz-Unable to parse URL without the 'idna' moduleT)�strict�
std3_ruleszName 'z' is not a valid IDNA labelrk)�isascii�idna�ImportErrorrrJr$�	IDNAError)rxr|rrrriLs

ri)�targetr)cCsTt�|�}|st|�d���|��\}}t|t�}|dk	rPt|t�}|d|7}|S)z�Percent-encodes a request target so that there are no invalid characters

    Pre-condition for this function is that 'target' must start with '/'.
    If that is the case then _TARGET_RE will always produce a match.
    z is not a valid request URINr)�
_TARGET_RErBr�groupsr>�_PATH_CHARS�_QUERY_CHARS)rrBr r!Zencoded_targetrrr�_encode_target_s


r�)r4r)c
Cs�|s
t�S|}t�|�s d|}�yt�|���\}}}}}|dkpN|��tk}|r\|��}|r�|�d�\}}	}
|pvd}t	�|
���\}}|r�|r�t
|t�}|dkr�d}n
d\}}}|dk	r�t|�}
d|
kr�dks�nt
|��nd}
t||�}|�r|�rt|�}t
|t�}|�r&|�r&t
|t�}|�r<|�r<t
|t�}Wn2ttfk
�rp}zt
|�|�Wdd}~XYnX|�s�|dk	�s�|dk	�r�d}nd}t||||
|||d�S)	a�
    Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
    performed to parse incomplete urls. Fields not provided will be None.
    This parser is RFC 3986 and RFC 6874 compliant.

    The parser logic and helper functions are based heavily on
    work done in the ``rfc3986`` module.

    :param str url: URL to parse into a :class:`.Url` namedtuple.

    Partly backwards-compatible with :mod:`urllib.parse`.

    Example:

    .. code-block:: python

        import urllib3

        print( urllib3.util.parse_url('http://google.com/mail/'))
        # Url(scheme='http', host='google.com', port=None, path='/mail/', ...)

        print( urllib3.util.parse_url('google.com:80'))
        # Url(scheme=None, host='google.com', port=80, path=None, ...)

        print( urllib3.util.parse_url('/foo?bar'))
        # Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...)
    z//Nrr2)NNNri��)rrrrr r!r")r�
_SCHEME_REro�_URI_RErBr�r$rl�
rpartition�
_HOST_PORT_REr>�_USERINFO_CHARS�intrrerdr�r��_FRAGMENT_CHARS�
ValueError�AttributeError)r4�
source_urlrr1r r!r"�
normalize_urir�_�	host_portrrZport_int�errr�	parse_urlqs\






r�)6�
__future__r�re�typing�
exceptionsr�utilrrl�compilerHr��UNICODE�DOTALLr�Z	_IPV4_PATZ_HEX_PAT�formatZ	_LS32_PATr
�_variationsZ_UNRESERVED_PATr`Z	_IPV6_PATZ_ZONE_ID_PATZ_IPV6_ADDRZ_PATZ
_REG_NAME_PATr�rrZ_IPV6_RErmZ_BRACELESS_IPV6_ADDRZ_RErn�_HOST_PORT_PATr��setrqZ_SUB_DELIM_CHARSr�r�r�r��
NamedTuple�Optionalr,r�r�overloadr>rdrerir�r�rrrr�<module>s�




{$