CasperSecurity

Current Path : /opt/hikvison/venv/lib/python3.10/site-packages/requests/__pycache__/
Upload File :
Current File : //opt/hikvison/venv/lib/python3.10/site-packages/requests/__pycache__/utils.cpython-310.pyc

o

B�Pj��@sBUdZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZmZddlmZmZmZmZmZmZddlmZmZdd	lmZdd
lmZddl m!Z!m"Z"m#Z#m$Z$ddl%m&Z'dd
l(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5ddl(m6Z7ddl8m9Z9ddl:m;Z;m<Z<m=Z=m>Z>ddl?m@Z@er�ddlAmBZBddlmCZCddlm%ZDddlEmFZFmGZGmHZHdZIdeJd<e�K�ZLdeJd<ddd�ZMdeJd<ed�ZNed �ZOd!�Pe�Qd"ed#d$�d%��ZRdeJd&<e
jSd'k�rd�d+d,�ZTd�d-d.�Z/d�d2d3�ZUd�d7d8�ZV	9d�d�d>d?�ZWd�dBdC�ZXd�dEdF�ZYejZd�dIdJ��Z[d�dNdO�Z\ed�dQdR��Z]ed�dUdR��Z]d�dXdR�Z]d�dZd[�Z^d�d]d^�Z_d�d�d`da�Z`d�ddde�Zad�dhdi�Zbd�dkdl�Zcd�dodp�Zdd�dsdt�Zed�dzd{�Zfed�d�d���Zged�d�d���Zgd�d�d��Zgd�d�d��Zheid��ZjdeJd�<d�d�d��Zkd�d�d��Zld�d�d��Zmd�d�d��Znd�d�d��Zod�d�d��ZpejZd�d�d���Zqd�d�d��Zrd�d�d�d��Zsd�d�d��Zt	#d�d�d�d��Zud�d�d�d��Zvd�d�d��Zwd�d�d��Zxd��yd��Zzezd�Z{ezd�Z|d�d�d��Z}d�d�dÄZ~�dd�dƄZ�dd�dɄZ��dd�d΄Z��dd�dЄZ��dd�dԄZ�dS(z�
requests.utils
~~~~~~~~~~~~~~

This module provides utility functions that are used within Requests
that are also useful for external consumption.
�)�annotationsN)�OrderedDict)�	Generator�Iterable)�
TYPE_CHECKING�Any�Final�TypeVar�cast�overload)�make_headers�	parse_url�)�certs��__version__)�_HEADER_VALIDATORS_BYTE�_HEADER_VALIDATORS_STR�HEADER_VALIDATORS�to_native_string)�
SupportsItems)
�Mapping�bytes�
getproxies�getproxies_environment�
integer_types�is_urllib3_1�proxy_bypass�proxy_bypass_environment�quote�str�unquote�urlparse�
urlunparse)�parse_http_list��cookiejar_from_dict)�FileModeWarning�
InvalidHeader�
InvalidURL�UnrewindableBodyError)�CaseInsensitiveDict)�	CookieJar)�BufferedWriter)�_types)�PreparedRequest�Request�Response)z.netrc�_netrcr�NETRC_FILESr �DEFAULT_CA_BUNDLE_PATH�Pi�)�http�https�
DEFAULT_PORTS�_KT�_VTz, z,\s*T)�accept_encodingzaccept-encoding�DEFAULT_ACCEPT_ENCODING�win32�host�return�boolc	Cs�zddl}Wn
tyYdSwz|�|jd�}t|�|d�d�}|�|d�d}Wnttfy8YdSw|r=|s?dS|�d�}t	d|�}|D]*}|dkrXd|vrXd	S|�
dd
�}|�
dd�}|�
d
d�}t�||tj
�rud	SqKdS)NrFz;Software\Microsoft\Windows\CurrentVersion\Internet Settings�ProxyEnable�
ProxyOverride�;z<local>�.Tz\.�*z.*�?)�winreg�ImportError�OpenKey�HKEY_CURRENT_USER�int�QueryValueEx�OSError�
ValueError�split�filter�replace�re�match�I)r>rG�internetSettings�proxyEnable�
proxyOverride�test�rY�A/opt/hikvison/venv/lib/python3.10/site-packages/requests/utils.py�proxy_bypass_registrycs<���

�r[cCst�rt|�St|�S)z�Return True, if the host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or the registry.
        )rrr[)r>rYrYrZr�sr�d�6_t.SupportsItems[Any, Any] | Iterable[tuple[Any, Any]]�Iterable[tuple[Any, Any]]cCst|t�r	|��S|S)z/Returns an internal sequence dictionary update.)�
isinstance�_SupportsItems�items)r\rYrYrZ�dict_to_sequence�s
rb�orrKc	Cs8d}d}tst|t�r|�d�}t|d�rt|�}n2t|d�r#|j}n)t|d�rLz|��}Wntjt	fy:Ynwt
�|�j}d|j
vrLt�dt�t|d�r�z|��}Wntyf|durd|}Yn)wt|d	�r�|dur�z|�dd
�|��}|�|p�d�Wnty�d}Ynw|dur�d}td||�S)Nr�utf-8�__len__�len�fileno�ba%Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.�tell�seek�)rr_r �encode�hasattrrfrg�io�UnsupportedOperation�AttributeError�os�fstat�st_size�mode�warnings�warnr'rirMrj�max)rc�total_length�current_positionrgrYrYrZ�	super_len�sN




�
�
���rzF�url�
_t.UriType�raise_errors�tuple[str, str] | Nonec
	Cs8t|t�r
|�d�}tj�d�}|dur|f}ndd�tD�}zpddlm}m}d}|D]}tj	�
|�}tj	�|�r>|}nq,|durFWdSt|�}	|	j
}
|
durTWdSz+||��|
�}|rxt|�r||drhdnd}||pod	|d
ptd	fWWSWWdSWWdS|tfy�|r��YWdSwttfy�YdSw)z;Returns the Requests tuple auth for a given url from netrc.rd�NETRCNcss�|]}d|��VqdS)z~/NrY)�.0�frYrYrZ�	<genexpr>�s�z!get_netrc_auth.<locals>.<genexpr>r)�NetrcParseError�netrcr�rk)r_r�decoderq�environ�getr3r�r��path�
expanduser�existsr"�hostname�authenticators�anyrMrHrp)
r{r}�
netrc_file�netrc_locationsr�r��
netrc_pathr��loc�rir>r2�login_irYrYrZ�get_netrc_auth�sF

�����r��obj�
str | NonecCsRt|dd�}|r!t|ttf�r#|ddkr%|ddkr'tj�|�SdSdSdSdS)z0Tries to guess the filename of the given object.�nameNr�<����>)�getattrr_r rrqr��basename)r�r�rYrYrZ�guess_filenames*�r�r�c	Cs�tj�|�r|Stj�|�\}}|r2tj�|�s2tj�|�\}}|s#nd�||g�}|r2tj�|�rt�|�s9|St�|�}||��vrF|Stj�	|�d�d�d}t
j|d�\}}zt�||�
|��Wt�|�|St�|�w)z�Replace nonexistent paths that look like they refer to a member of a zip
    archive with the location of an extracted copy of the target, or else
    just return the provided path unchanged.
    �/r�)�suffix)rqr�r�rO�join�zipfile�
is_zipfile�ZipFile�namelist�splitext�tempfile�mkstemp�write�read�close)r��archive�member�prefix�zip_filer��fd�extracted_pathrYrYrZ�extract_zipped_paths"s*�


�r��filename�%Generator[BufferedWriter, None, None]ccsz�tjtj�|�d�\}}z"t�|d��}|VWd�n1s"wYt�||�WdSty<t�|��w)z-Write a file to the disk in an atomic fashion)�dir�wbN)	r�r�rqr��dirname�fdopenrQ�
BaseException�remove)r��tmp_descriptor�tmp_name�tmp_handlerrYrYrZ�atomic_openHs��
�r��value�4Mapping[Any, Any] | Iterable[tuple[Any, Any]] | None�dict[Any, Any] | NonecCs.|durdSt|ttttf�rtd��t|�S)aTake an object and test to see if it can be represented as a
    dictionary. Unless it can not be represented as such, return an
    OrderedDict, e.g.,

    ::

        >>> from_key_val_list([('key', 'val')])
        OrderedDict([('key', 'val')])
        >>> from_key_val_list('string')
        Traceback (most recent call last):
        ...
        ValueError: cannot encode objects that are not 2-tuples
        >>> from_key_val_list({'key': 'val'})
        OrderedDict([('key', 'val')])

    :rtype: OrderedDict
    N�+cannot encode objects that are not 2-tuples)r_r rr@rKrNr�r�rYrYrZ�from_key_val_listUs
r��NonecC�dS�NrYr�rYrYrZ�to_key_val_listrsr��6_t.SupportsItems[_KT, _VT] | Iterable[tuple[_KT, _VT]]�list[tuple[_KT, _VT]]cCr�r�rYr�rYrYrZr�t��=_t.SupportsItems[_KT, _VT] | Iterable[tuple[_KT, _VT]] | None�list[tuple[_KT, _VT]] | NonecCsD|durdSt|ttttf�rtd��t|t�rt|���St|�S)a�Take an object and test to see if it can be represented as a
    dictionary. If it can be, return a list of tuples, e.g.,

    ::

        >>> to_key_val_list([('key', 'val')])
        [('key', 'val')]
        >>> to_key_val_list({'key': 'val'})
        [('key', 'val')]
        >>> to_key_val_list('string')
        Traceback (most recent call last):
        ...
        ValueError: cannot encode objects that are not 2-tuples

    :rtype: list
    Nr�)	r_r rr@rKrNr`�listrar�rYrYrZr�xs
�	list[str]cCsXg}t|�D]#}|dd�|dd�krdkr$nnt|dd��}|�|�q|S)aParse lists as described by RFC 2068 Section 2.

    In particular, parse comma-separated lists where the elements of
    the list may include quoted-strings.  A quoted-string could
    contain a comma.  A non-quoted string could have quotes in the
    middle.  Quotes are removed automatically after parsing.

    It basically works like :func:`parse_set_header` just that items
    may appear multiple times and case sensitivity is preserved.

    The return value is a standard :class:`list`:

    >>> parse_list_header('token, "quoted value"')
    ['token', 'quoted value']

    To create a header from the :class:`list` again, use the
    :func:`dump_header` function.

    :param value: a string with a list header.
    :return: :class:`list`
    :rtype: list
    Nrr��")�_parse_list_header�unquote_header_value�append)r��result�itemrYrYrZ�parse_list_header�s(r��dict[str, str | None]cCsxi}t|�D]3}d|vrd||<q|�dd�\}}|dd�|dd�kr+dkr5nnt|dd��}|||<q|S)a^Parse lists of key, value pairs as described by RFC 2068 Section 2 and
    convert them into a python dict:

    >>> d = parse_dict_header('foo="is a fish", bar="as well"')
    >>> type(d) is dict
    True
    >>> sorted(d.items())
    [('bar', 'as well'), ('foo', 'is a fish')]

    If there is no value for a key it will be `None`:

    >>> parse_dict_header('key_without_value')
    {'key_without_value': None}

    To create a header from the :class:`dict` again, use the
    :func:`dump_header` function.

    :param value: a string with a dict header.
    :return: :class:`dict`
    :rtype: dict
    �=Nrr�r�)r�rOr�)r�r�r�r�rYrYrZ�parse_dict_header�s(
r��is_filenamecCs^|r-|d|dkrdkr-n|S|dd�}|r#|dd�dkr-|�dd��d	d�S|S)
z�Unquotes a header value.  (Reversal of :func:`quote_header_value`).
    This does not use the real unquoting but what browsers are actually
    using for quoting.

    :param value: the header value to unquote.
    :rtype: str
    rr�r�rNrkz\\�\z\")rQ)r�r�rYrYrZr��s"�r��cjr,cCsdd�|D�}|S)z�Returns a key/value dictionary from a CookieJar.

    :param cj: CookieJar object to extract cookies from.
    :rtype: dict
    cSsi|]}|j|j�qSrY)r�r�)r��cookierYrYrZ�
<dictcomp>�sz'dict_from_cookiejar.<locals>.<dictcomp>rY�r��cookie_dictrYrYrZ�dict_from_cookiejar�sr�r��dict[str, str]cCs
t||�S)z�Returns a CookieJar from a key/value dictionary.

    :param cj: CookieJar to insert cookies into.
    :param cookie_dict: Dict of key/values to insert into CookieJar.
    :rtype: CookieJar
    r%r�rYrYrZ�add_dict_to_cookiejar�s
r��contentcCsTt�dt�tjdtjd�}tjdtjd�}t�d�}|�|�|�|�|�|�S)zlReturns encodings from given content string.

    :param content: bytestring to extract encodings from.
    z�In requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)z!<meta.*?charset=["\']*(.+?)["\'>])�flagsz+<meta.*?content=["\']*;?charset=(.+?)["\'>]z$^<\?xml.*?encoding=["\']*(.+?)["\'>])rurv�DeprecationWarningrR�compilerT�findall)r��
charset_re�	pragma_re�xml_rerYrYrZ�get_encodings_from_content
s�	
���r��header�tuple[str, dict[str, Any]]c
Cs�|�d�}|d��|dd�}}i}d}|D]+}|��}|rC|�d�}dkrC|d|��|�}||dd��|�}	|	||��<q||fS)z�Returns content type and parameters from given header.

    :param header: string
    :return: tuple containing content type and dictionary of
         parameters.
    rCrrNz"' r�r�)rO�strip�find�lower)
r��tokens�content_type�params�params_dict�strip_chars�param�idx�keyr�rYrYrZ�_parse_content_type_header#s
�r��headers�CaseInsensitiveDict[str]cCsP|�d�}|s	dSt|�\}}d|vr|d�d�Sd|vr dSd|vr&dSdS)	z}Returns encodings from given HTTP Header Dict.

    :param headers: dictionary to extract encoding from.
    :rtype: str
    zcontent-typeN�charsetz'"�textz
ISO-8859-1zapplication/jsonrd)r�r�r�)r�r�r�rYrYrZ�get_encoding_from_headers9s
�r��iterator�Iterable[bytes]�rr1�"Generator[str | bytes, None, None]ccsj�|jdur
|EdHdSt�|j�dd�}|D]}|�|�}|r$|Vq|jddd�}|r3|VdSdS)zStream decodes an iterator.NrQ��errors�T)�final)�encoding�codecs�getincrementaldecoderr�)rr�decoder�chunk�rvrYrYrZ�stream_decode_response_unicodeRs�


�
�r�stringr�slice_length�
int | None�Generator[bytes, None, None]cCr�r�rY�rrrYrYrZ�iter_sliceser�r�Generator[str, None, None]cCr�r�rYrrYrYrZrir��bytes | str�"Generator[bytes | str, None, None]ccsX�d}|dus|dkrt|�}|t|�kr*||||�V||7}|t|�ksdSdS)z Iterate over slices of a string.rN)rf)rr�posrYrYrZrms���str | bytes | NonecCs�t�dt�|jdur
dSg}t|j�}|r,zt|j|�WSty+|�|�Ynwzt|j|p3ddd�WSt	yC|jYSw)z�Returns the requested content back in unicode.

    :param r: Response object to get unicode content from.

    Tried:

    1. charset from content-type
    2. fall back and replace all unicode characters

    :rtype: str
    z�In requests 3.0, get_unicode_from_response will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)NrdrQr)
rurvr�r�r�r�r �UnicodeErrorr��	TypeError)r�tried_encodingsrrYrYrZ�get_unicode_from_responseys&�

�
�rzBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~�UNRESERVED_SET�uric	Cs�|�d�}tdt|��D]Q}||dd�}t|�dkrT|��rTz	tt|d��}Wnty8td|�d���w|tvrJ|||dd�||<qd||��||<qd||��||<qd	�	|�S)
z�Un-escape any percent-escape sequences in a URI that are unreserved
    characters. This leaves all reserved, illegal and non-ASCII bytes encoded.

    :rtype: str
    �%rrrk�z"Invalid percent-escape sequence: '�'Nr�)
rO�rangerf�isalnum�chrrKrNr)rr�)r�parts�i�h�crYrYrZ�unquote_unreserved�s
�
r*cCs:d}d}z	tt|�|d�WStyt||d�YSw)z�Re-quote the given URI.

    This function passes the given URI through an unquote/quote cycle to
    ensure that it is fully and consistently quoted.

    :rtype: str
    z!#$%&'()*+,/:;=?@[]~z!#$&'()*+,/:;=?@[]~)�safe)rr*r))r�safe_with_percent�safe_without_percentrYrYrZ�requote_uri�s�r.�ip�netcCslt�dt�|��d}|�d�\}}t�dt�tt|����d}t�dt�|��d|@}||@||@kS)z�This function allows you to check if an IP belongs to a network subnet

    Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24
             returns False if ip = 192.168.1.1 and net = 192.168.100.0/24

    :rtype: bool
    z=Lrr�)�struct�unpack�socket�	inet_atonrO�dotted_netmaskrK)r/r0�ipaddr�netaddr�bits�netmask�networkrYrYrZ�address_in_network�s
r;�maskcCs&ddd|>dA}t�t�d|��S)z�Converts mask from /xx format to xxx.xxx.xxx.xxx

    Example: if mask is 24 function returns 255.255.255.0

    :rtype: str
    l��r� z>I)r3�	inet_ntoar1�pack)r<r8rYrYrZr5�sr5�	string_ipcCs&zt�|�WdStyYdSw)z
    :rtype: bool
    FT)r3r4rM)r@rYrYrZ�is_ipv4_address�s��rA�string_networkcCs�|�d�dkr?zt|�d�d�}Wn
tyYdSw|dks%|dkr'dSz
t�|�d�d�WdSty>YdSwdS)zV
    Very simple check of the cidr format in no_proxy variable.

    :rtype: bool
    r�rFr=rT)�countrKrOrNr3r4rM)rBr<rYrYrZ�
is_valid_cidr�s���rD�env_name�Generator[None, None, None]c	cs~�|du}d}|rtj�|�}|tj|<zdVW|r,|dur%tj|=dS|tj|<dSdS|r>|dur9tj|=w|tj|<w)z�Set the environment variable 'env_name' to 'value'

    Save previous value, yield, and then restore the previous value stored in
    the environment variable 'env_name'.

    If 'value' is None, do nothingN)rqr�r�)rEr��
value_changed�	old_valuerYrYrZ�set_environs �
�rI�no_proxyc
CsZddd�}|}|dur|d�}t|�}|j}|durd	S|r}d
d�|�dd
��d�D�}t|�rJ|D]}t|�rAt||�r@d	Sq2||krHd	Sq2n3|}|jrW|d|j��7}|D]#}	|	�d�}	||	ksh||	krkd	Sd|	}	|�	|	�sy|�	|	�r|d	SqYt
d|��zt|�}
Wntt
jfy�d}
YnwWd�n1s�wY|
r�d	SdS)zL
    Returns whether we should bypass proxies or not.

    :rtype: bool
    r�r r?r�cSstj�|�p
tj�|���Sr�)rqr�r��upper)r�rYrYrZ�	get_proxy3sz(should_bypass_proxies.<locals>.get_proxyNrJTcss�|]}|r|VqdSr�rY)r�r>rYrYrZr�Es�z(should_bypass_proxies.<locals>.<genexpr>� r��,�:rDF)r�r r?r�)r"r�rQrOrArDr;�port�lstrip�endswithrIrrr3�gaierror)r{rJrL�no_proxy_arg�parsedr��no_proxy_hosts�proxy_ip�host_with_portr>�bypassrYrYrZ�should_bypass_proxies*sT
	
���	
����rZcCst||d�riSt�S)zA
    Return a dict of environment proxies.

    :rtype: dict
    �rJ)rZr)r{rJrYrYrZ�get_environ_proxiesisr\�proxies�dict[str, str] | NonecCsv|pi}t|�}|jdur|�|j|�d��S|jd|j|jd|jdg}d}|D]
}||vr8||}|Sq+|S)z�Select a proxy for the url, if applicable.

    :param url: The url being for the request
    :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs
    N�allz://zall://)r"r�r��scheme)r{r]�urlparts�
proxy_keys�proxy�	proxy_keyrYrYrZ�select_proxyus"
��re�request�Request | PreparedRequest�	trust_envc	Csz|dur|ni}tt|j�}t|�j}|�d�}|��}|r;t||d�s;t||d�}|�||�d��}|r;|�	||�|S)a�This method takes proxy information from a request and configuration
    input to resolve a mapping of target proxies. This will consider settings
    such as NO_PROXY to strip proxy configurations.

    :param request: Request or PreparedRequest
    :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs
    :param trust_env: Boolean declaring whether to trust environment configs

    :rtype: dict
    NrJr[r_)
r
r r{r"r`r��copyrZr\�
setdefault)	rfr]rhr{r`rJ�new_proxies�environ_proxiesrcrYrYrZ�resolve_proxies�s

rm�python-requestsr�cCs|�dt��S)zO
    Return a string representing the default user agent.

    :rtype: str
    r�r)r�rYrYrZ�default_user_agent�srocCstt�tddd��S)z9
    :rtype: requests.structures.CaseInsensitiveDict
    z*/*z
keep-alive)z
User-AgentzAccept-Encoding�Accept�
Connection)r+ror<rYrYrYrZ�default_headers�s��rr�list[dict[str, str]]c	
Cs�g}d}|�|�}|s
|St�d|�D]M}z
|�dd�\}}Wnty-|d}}Ynwd|�d�i}|�d�D] }z	|�d�\}}Wn
tyOYnw|�|�||�|�<q:|�|�q|S)	z�Return a list of parsed link headers proxies.

    i.e. Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg",<http://.../back.jpeg>; rel=back;type="image/jpeg"

    :rtype: list
    z '"z, *<rCrr�r{z<> '"r�)r�rRrOrNr�)	r��links�
replace_chars�valr{r��linkr�r�rYrYrZ�parse_header_links�s*
��rx��asciirk��datacCs�|dd�}|tjtjfvrdS|dd�tjkrdS|dd�tjtjfvr)dS|�t�}|dkr4d	S|dkrN|ddd�tkrCd
S|ddd�tkrNdS|dkrf|dd�t	kr\d
S|dd�t	krfdSdS)z
    :rtype: str
    N�zutf-32r{z	utf-8-sigrkzutf-16rrdz	utf-16-berz	utf-16-lez	utf-32-bez	utf-32-le)
r	�BOM_UTF32_LE�BOM_UTF32_BE�BOM_UTF8�BOM_UTF16_LE�BOM_UTF16_BErC�_null�_null2�_null3)r|�sample�	nullcountrYrYrZ�guess_json_utf�s*
r��
new_schemecCsvt|�}|\}}}}}}}	|j}
|
s||
}
}|r%tt|
�}
d�||
g�}
|dur+|}|dur1d}t||
|d||	f�S)z�Given a URL that may or may not have a scheme, prepend the given scheme.
    Does not replace a present scheme with the one provided as an argument.

    :rtype: str
    �@Nr�)r
�netlocr
r r�r#)r{r�rUr`�auth�_host�_portr��query�fragmentr�rYrYrZ�prepend_scheme_if_neededs

r��tuple[str, str]c	Cs@t|�}z
t|j�t|j�f}W|Sttfyd}Y|Sw)z{Given a url with authentication components, extract them into a tuple of
    username,password.

    :rtype: (str,str)
    )r�r�)r"r!�username�passwordrpr)r{rUr�rYrYrZ�get_auth_from_url.s��r��tuple[str | bytes, str | bytes]cCs$|\}}t||d�t||d�dS)z�Verifies that header parts don't contain leading whitespace
    reserved characters, or return characters.

    :param header: tuple, in the format (name, value).
    rrN)�_validate_header_part)r�r�r�rYrYrZ�check_header_validity?sr��header_part�str | bytes�header_validator_indexcCsxt|t�r
t|}nt|t�rt|}ntd|�d|�dt|�����|�|�s:|dkr.dnd}td|�d|����dS)	Nz
Header part (z) from z# must be of type str or bytes, not rr�r�zTInvalid leading whitespace, reserved character(s), or return character(s) in header z: )r_r rrrr(�typerS)r�r�r��	validator�header_kindrYrYrZr�Js&



��
����r�cCsFt|�\}}}}}}|s||}}|�dd�d}t|||||df�S)zW
    Given a url remove the fragment and the authentication part.

    :rtype: str
    r�rr�r�)r"�rsplitr#)r{r`r�r�r�r��	_fragmentrYrYrZ�
urldefragauthbs

r��prepared_requestr/cCsRt|jdd�}|dur%t|jt�r%z||j�WdSty$td��wtd��)zfMove file pointer back to its recorded starting position
    so it can be read again on redirect.
    rjNz;An error occurred when rewinding request body for redirect.z+Unable to rewind request body for redirect.)r��bodyr_�_body_positionrrMr*)r��	body_seekrYrYrZ�rewind_bodyss
���r�)r>r r?r@)r\r]r?r^)rcrr?rK)F)r{r|r}r@r?r~)r�rr?r�)r�r r?r )r�r r?r�)r�r�r?r�)r�r�r?r�)r�r�r?r�)r�r�r?r�)r�r r?r�)r�r r?r�)r�r r�r@r?r )r�r,r?r�)r�r,r�r�r?r,)r�r r?r�)r�r r?r�)r�r�r?r�)rrrr1r?r)rrrrr?r)rr rrr?r)rrrrr?r)rr1r?r)rr r?r )r/r r0r r?r@)r<rKr?r )r@r r?r@)rBr r?r@)rEr r�r�r?rF)r{r rJr�r?r@r�)r{r rJr�r?r�)r{r r]r^r?r�)T)rfrgr]r^rhr@r?r�)rn)r�r r?r )r?r�)r�r r?rs)r|rr?r�)r{r r�r r?r )r{r r?r�)r�r�r?r�)r�r�r�r�r�rKr?r�)r{r r?r )r�r/r?r�)��__doc__�
__future__rr	�
contextlibrnrqrRr3r1�sysr�rur��collectionsr�collections.abcrr�typingrrrr	r
r�urllib3.utilrr
r�rr�_internal_utilsrrrrr.rr`�compatrrrrrrrrrr r!r"r#r$r��cookiesr&�
exceptionsr'r(r)r*�
structuresr+�http.cookiejarr,r-�_t�modelsr/r0r1r3�__annotations__�wherer4r8r9r:r�rOr<�platformr[rbrzr�r�r��contextmanagerr�r�r�r�r�r�r�r�r�r�r�rrr�	frozensetrr*r.r;r5rArDrIrZr\rermrorrrxrlr�r�r�r�r�r�r�r�r�r�rYrYrYrZ�<module>s� 	<�

&

H�
4
&


 
 #







*�






?
�
	

&

 
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY