https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib/python2.7/site-packages/werkzeug/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python2.7/site-packages/werkzeug/http.pyc
�
./�_c@s�dZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddlmZdd	l
mZdd
l
mZddl
m
Z
ddl
mZdd
l
mZddl
mZddl
mZddl
mZddlmZddlmZddlmZyddlmZWn!ek
raddlmZnXy$ddlmZddlmZ Wn1ek
r�ddl!mZddl!m"Z nXdZ#dZ$ej%dej&�Z'e(d�Z)ej%d�Z*e+d�Z,ej%ddej&�Z-ej%d �Z.e(d!d"d#d$d%d&d'd(d)d*g
�Z/e(d+d,d-d.d/d0d1d2g�Z0i@d3d46d5d66d7d86d9d:6d;d<6d=d>6d?d@6dAdB6dCdD6dEdF6dGdH6dIdJ6dKdL6dMdN6dOdP6dQdR6dSdT6dUdV6dWdX6dYdZ6d[d\6d]d^6d_d`6dadb6dcdd6dedf6dgdh6didj6dkdl6dmdn6dodp6dqdr6dsdt6dudv6dwdx6dydz6d{d|6d}d~6dd�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6Z1d��Z2d��Z3d�e4d��Z5e6d��Z7d��Z8e4d��Z9d��Z:d��Z;e<d��Z=e6d��Z>dd��Z@ddd��ZAddd��ZBdd��ZCd��ZDdd��ZEd��ZFe4d��ZGdd��ZHe6d��ZId��ZJd��ZKd��ZLd��ZMd��ZNdd��ZOdd��ZPdd��ZQdd��ZRddde4d��ZSd�d��ZTd��ZUd��ZVd��ZWdd�dd��ZXd�ddd�de6e6de4d�dd��ZYd��ZZdd�l[m\Z\dd�l[m]Z]dd�l[m^Z^dd�l[m_Z_dd�l[m`Z`dd�l[maZadd�l[mbZbdd�l[mcZcdd�l[mdZddd�l[meZedd�l[mfZfdS(�s"
    werkzeug.http
    ~~~~~~~~~~~~~

    Werkzeug comes with a bunch of utilities that help Werkzeug to deal with
    HTTP data.  Most of the classes and functions provided by this module are
    used by the wrappers, but they are useful on their own, too, especially if
    the response and request objects are not used.

    This covers some of the more HTTP centric features of WSGI, some other
    utilities such as cookie handling are documented in the `werkzeug.utils`
    module.


    :copyright: 2007 Pallets
    :license: BSD-3-Clause
i����N(tdatetime(t	timedelta(tmd5(tgmtime(ttimei(t
integer_types(t	iteritems(tPY2(tstring_types(t	text_type(tto_bytes(t
to_unicode(ttry_coerce_native(t_cookie_parse_impl(t
_cookie_quote(t_make_cookie_domain(tparsedate_tz(tparse_http_list(tunquote_to_bytes(tunquotetlatin1sutf-8s�
    (                       # media-range capturing-parenthesis
      [^\s;,]+              # type/subtype
      (?:[ \t]*;[ \t]*      # ";"
        (?:                 # parameter non-capturing-parenthesis
          [^\s;,q][^\s;,]*  # token that doesn't start with "q"
        |                   # or
          q[^\s;,=][^\s;,]* # token that is more than just "q"
        )
      )*                    # zero or more parameters
    )                       # end of media-range
    (?:[ \t]*;[ \t]*q=      # weight is a "q" parameter
      (\d*(?:\.\d+)?)       # qvalue capturing-parentheses
      [^,]*                 # "extension" accept params: who cares?
    )?                      # accept params are optional
    sM!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~s&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$)s()<>@,;:"/[]?={} 	s�
    ;\s*,?\s*  # newlines were replaced with commas
    (?P<key>
        "[^"\\]*(?:\\.[^"\\]*)*"  # quoted string
    |
        [^\s;,=*]+  # token
    )
    (?:\*(?P<count>\d+))?  # *1, optional continuation index
    \s*
    (?:  # optionally followed by =value
        (?:  # equals sign, possibly with encoding
            \*\s*=\s*  # * indicates extended notation
            (?:  # optional encoding
                (?P<encoding>[^\s]+?)
                '(?P<language>[^\s]*?)'
            )?
        |
            =\s*  # basic notation
        )
        (?P<value>
            "[^"\\]*(?:\\.[^"\\]*)*"  # quoted string
        |
            [^;,]+  # token
        )?
    )?
    \s*
    tflagss,\s*([^;,\s]+)([;,]\s*.+)?tallowscontent-encodingscontent-languagescontent-lengthscontent-locationscontent-md5s
content-rangescontent-typetexpiress
last-modifiedt
connections
keep-alivesproxy-authenticatesproxy-authorizationttettrailerstransfer-encodingtupgradetContinueidsSwitching Protocolsiet
ProcessingifsEarly HintsigtOKi�tCreatedi�tAcceptedi�sNon Authoritative Informationi�s
No Contenti�s
Reset Contenti�sPartial Contenti�sMulti Statusi�sAlready Reportedi�sIM Usedi�sMultiple Choicesi,sMoved Permanentlyi-tFoundi.s	See Otheri/sNot Modifiedi0s	Use Proxyi1sSwitch Proxyi2sTemporary Redirecti3sPermanent Redirecti4sBad Requesti�tUnauthorizedi�sPayment Requiredi�t	Forbiddeni�s	Not Foundi�sMethod Not Allowedi�sNot Acceptablei�sProxy Authentication Requiredi�sRequest Timeouti�tConflicti�tGonei�sLength Requiredi�sPrecondition Failedi�sRequest Entity Too Largei�sRequest URI Too Longi�sUnsupported Media Typei�sRequested Range Not Satisfiablei�sExpectation Failedi�sI'm a teapoti�sMisdirected Requesti�sUnprocessable Entityi�tLockedi�sFailed Dependencyi�s	Too Earlyi�sUpgrade Requiredi�sPrecondition Requiredi�sToo Many Requestsi�sRequest Header Fields Too Largei�s
Retry Withi�sUnavailable For Legal Reasonsi�sInternal Server Errori�sNot Implementedi�sBad Gatewayi�sService Unavailablei�sGateway Timeouti�sHTTP Version Not Supportedi�sVariant Also Negotiatesi�sInsufficient Storagei�s
Loop Detectedi�sNot Extendedi�sNetwork Authentication Failedi�cCs t|t�r|S|jd�S(s2coerce wsgi unicode represented bytes to real onesR(t
isinstancetbytestencode(tdata((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt
wsgi_to_bytes�scCs?t|t�std��t|t�r.|S|jd�SdS(Nsdata must be bytesR(R'R(tAssertionErrortstrtdecode(R*((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt
bytes_to_wsgi�stcCs|t|t�rt|�}nt|�}|r\tt|�B}t|�j|�r\|Snd|jdd�jdd�S(sQuote a header value if necessary.

    .. versionadded:: 0.5

    :param value: the value to quote.
    :param extra_chars: a list of extra characters to skip quoting.
    :param allow_token: if this is enabled token values are returned
                        unchanged.
    s"%s"s\s\\t"s\"(R'R(R/R-t_token_charstsettissubsettreplace(tvaluetextra_charstallow_tokenttoken_chars((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytquote_header_value�s
cCsq|rm|d|dko%dknrm|dd!}|sN|d dkrm|jdd�jdd�Sn|S(	s�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.

    .. versionadded:: 0.5

    :param value: the header value to unquote.
    ii����R1iis\\s\s\"(R5(R6tis_filename((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytunquote_header_value�s
	*
cCs�g}|dk	r"|j|�nxSt|�D]E\}}|dkrW|j|�q/|jd|t|�f�q/Wdj|�S(s�The reverse function to :func:`parse_options_header`.

    :param header: the header to dump
    :param options: a dict of options to append.
    s%s=%ss; N(tNonetappendRR:tjoin(theadertoptionstsegmentstkeyR6((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytdump_options_headers!cCs�t|t�rtg}x�t|�D]K\}}|dkrJ|j|�q"|jd|t|d|�f�q"Wn%g|D]}t|d|�^q{}dj|�S(sJDump an HTTP header again.  This is the reversal of
    :func:`parse_list_header`, :func:`parse_set_header` and
    :func:`parse_dict_header`.  This also quotes strings that include an
    equals sign unless you pass it as dict of key, value pairs.

    >>> dump_header({'foo': 'bar baz'})
    'foo="bar baz"'
    >>> dump_header(('foo', 'bar baz'))
    'foo, "bar baz"'

    :param iterable: the iterable or dict of values to quote.
    :param allow_token: if set to `False` tokens as values are disallowed.
                        See :func:`quote_header_value` for more details.
    s%s=%sR8s, N(R'tdictRR=R>R:R?(titerableR8titemsRCR6tx((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytdump_headers$%cCsdjd�t|�D��S(s�Dump a Content Security Policy header.

    These are structured into policies such as "default-src 'self';
    script-src 'self'".

    .. versionadded:: 1.0.0
       Support for Content Security Policy headers was added.

    s; css%|]\}}d||fVqdS(s%s %sN((t.0RCR6((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pys	<genexpr>Ds(R?R(R@((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytdump_csp_header:s
cCshg}x[t|�D]M}|d |dko8dknrSt|dd!�}n|j|�qW|S(s�Parse 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`
    ii����R1(t_parse_list_headerR<R>(R6tresulttitem((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_list_headerGs$cCs�|�}t|t�s't|�}nx�t|�D]~}d|krVd||<q4n|jdd�\}}|d |dko�dknr�t|dd!�}n|||<q4W|S(sKParse lists of key, value pairs as described by RFC 2068 Section 2 and
    convert them into a python dict (or any other mapping object created from
    the type with a dict like interface provided by the `cls` argument):

    >>> 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.

    .. versionchanged:: 0.9
       Added support for `cls` argument.

    :param value: a string with a dict header.
    :param cls: callable to use for storage of parsed results.
    :return: an instance of `cls`
    t=ii����R1N(R'R	R/RLR=tsplitR<(R6tclsRMRNtname((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_dict_headeres	
$c
Cs�|sdifSg}d|jdd�}xs|r�tj|�}|sNPn|j|jd��i}|jd�}d}x�|rttj|�}|s�Pn|j�\}}	}
}}|	s�d}n|
s�|}
n|
}t|�}|dk	r4t||dk�}|
dk	r4t	|�j
|
�}q4n|	rW|j|d�|||<n
|||<||j�}q�W|j|�|t
kr�t|�S|}q/W|r�t|�SdifS(s�Parse a ``Content-Type`` like header into a tuple with the content
    type and the options:

    >>> parse_options_header('text/html; charset=utf8')
    ('text/html', {'charset': 'utf8'})

    This should not be used to parse ``Cache-Control`` like headers that use
    a slightly different format.  For these headers use the
    :func:`parse_dict_header` function.

    .. versionchanged:: 0.15
        :rfc:`2231` parameter continuations are handled.

    .. versionadded:: 0.5

    :param value: the header to parse.
    :param multiple: Whether try to parse and return multiple MIME types
    :return: (mimetype, options) or (mimetype, options, mimetype, options, …)
             if multiple=True
    R0t,s
iitfilenameN(R5t_option_header_start_mime_typetmatchR>tgroupR=t_option_header_piece_retgroupsR<t_unquoteR.tgettendtFalsettuple(
R6tmultipleRMRXRAtresttcontinued_encodingtoptmatchtoptiontcounttencodingtlanguagetoption_value((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_options_header�sH
				



cCs�|dkrt}n|s%|d�Sg}xotj|�D]^}|jd�}|s_d}nttt|�d�d�}|j|jd�|f�q;W||�S(s�Parses an HTTP Accept-* header.  This does not implement a complete
    valid algorithm but one that supports at least value and quality
    extraction.

    Returns a new :class:`Accept` object (basically a list of ``(value, quality)``
    tuples sorted by the quality with some additional accessor methods).

    The second parameter can be a subclass of :class:`Accept` that is created
    with the parsed values and returned.

    :param value: the accept header string to be parsed.
    :param cls: the wrapper class for the return value (can be
                         :class:`Accept` or a subclass thereof)
    :return: an instance of `cls`.
    iiiN(	R=tAcceptt
_accept_retfinditerRYtmaxtmintfloatR>(R6RRRMRXtquality((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_accept_header�s	
	 cCs;|dkrt}n|s(|d|�S|t|�|�S(sParse a cache control header.  The RFC differs between response and
    request cache control, this method does not.  It's your responsibility
    to not use the wrong control statements.

    .. versionadded:: 0.5
       The `cls` was added.  If not specified an immutable
       :class:`~werkzeug.datastructures.RequestCacheControl` is returned.

    :param value: a cache control header to be parsed.
    :param on_update: an optional callable that is called every time a value
                      on the :class:`~werkzeug.datastructures.CacheControl`
                      object is changed.
    :param cls: the class for the returned object.  By default
                :class:`~werkzeug.datastructures.RequestCacheControl` is used.
    :return: a `cls` object.
    N(R=tRequestCacheControlRT(R6t	on_updateRR((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_cache_control_header�s
	
cCs�|dkrt}n|dkr.|d|�Sg}xo|jd�D]^}|j�}d|krD|j�jdd�\}}|j|j�|j�f�qDqDW|||�S(s�Parse a Content Security Policy header.

    .. versionadded:: 1.0.0
       Support for Content Security Policy headers was added.

    :param value: a csp header to be parsed.
    :param on_update: an optional callable that is called every time a value
                      on the object is changed.
    :param cls: the class for the returned object.  By default
                :class:`~werkzeug.datastructures.ContentSecurityPolicy` is used.
    :return: a `cls` object.
    t;t iN(R=tContentSecurityPolicyRQtstripR>(R6RtRRRGtpolicyt	directive((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_csp_headers	
&cCs&|std|�Stt|�|�S(sParse a set-like header and return a
    :class:`~werkzeug.datastructures.HeaderSet` object:

    >>> hs = parse_set_header('token, "quoted value"')

    The return value is an object that treats the items case-insensitively
    and keeps the order of the items:

    >>> 'TOKEN' in hs
    True
    >>> hs.index('quoted value')
    1
    >>> hs
    HeaderSet(['token', 'quoted value'])

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

    :param value: a set header to be parsed.
    :param on_update: an optional callable that is called every time a
                      value on the :class:`~werkzeug.datastructures.HeaderSet`
                      object is changed.
    :return: a :class:`~werkzeug.datastructures.HeaderSet`
    N(t	HeaderSetR=RO(R6Rt((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_set_header+s
cCsC|s
dSt|�}y(|jdd�\}}|j�}Wntk
rRdSX|dkr�y%tj|�jdd�\}}Wntk
r�dSXtdit	|t
�d6t	|t
�d6�S|dkr?t|�}xdD]}||kr�dSq�Wd|kr2|jd
�s+|jd�r2dSntd|�SdS(swParse an HTTP basic/digest authorization header transmitted by the web
    browser.  The return value is either `None` if the header was invalid or
    not given, otherwise an :class:`~werkzeug.datastructures.Authorization`
    object.

    :param value: the authorization header to parse.
    :return: a :class:`~werkzeug.datastructures.Authorization` object or `None`.
    Nitbasict:tusernametpasswordtdigesttrealmtnonceturitresponsetqoptnctcnonce(susernamesrealmsnoncesurisresponse(
R+RQR=tlowert
ValueErrortbase64t	b64decodet	Exceptiont
AuthorizationRt_basic_auth_charsetRTR](R6t	auth_typet	auth_infoR�R�tauth_mapRC((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_authorization_headerIs6	
%

 cCs�|std|�Sy(|jdd�\}}|j�}Wn0ttfk
rmt|j�j�d|�SXt|t|�|�S(s�Parse an HTTP WWW-Authenticate header into a
    :class:`~werkzeug.datastructures.WWWAuthenticate` object.

    :param value: a WWW-Authenticate header to parse.
    :param on_update: an optional callable that is called every time a value
                      on the :class:`~werkzeug.datastructures.WWWAuthenticate`
                      object is changed.
    :return: a :class:`~werkzeug.datastructures.WWWAuthenticate` object.
    RtiN(tWWWAuthenticateRQR=R�R�tAttributeErrorRyRT(R6RtR�R�((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_www_authenticate_headerqs

cCsF|s
t�St|�}|dk	r2td|�Stt|�d�S(s�Parses an if-range header which can be an etag or a date.  Returns
    a :class:`~werkzeug.datastructures.IfRange` object.

    .. versionadded:: 0.7
    tdateiN(tIfRanget
parse_dateR=tunquote_etag(R6R�((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_if_range_header�s
c	Cs�|sd|krdSg}d}|jdd�\}}|j�j�}xU|jd�D]D}|j�}d|krdS|jd�r�|dkr�dSyt|�}Wntk
r�dSXd}d}n�d|kr�|jdd�\}}|j�}|j�}|j�sdSt|�}||ksB|dkrFdS|r|j�s\dSt|�d}||kr�dSnd}|}n|j||f�q]Wt	||�S(sParses a range header into a :class:`~werkzeug.datastructures.Range`
    object.  If the header is missing or malformed `None` is returned.
    `ranges` is a list of ``(start, stop)`` tuples where the ranges are
    non-inclusive.

    .. versionadded:: 0.7
    RPiiRUt-i����N(
R=RQRyR�t
startswithtintR�tisdigitR>tRange(	R6tmake_inclusivetrangestlast_endtunitstrngRNtbeginR^((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_range_header�sL
		cCsZ|dkrdSy(|pdj�jdd�\}}Wntk
rLdSXd|kr]dS|jdd�\}}|dkr�d}n|j�r�t|�}ndS|dkr�t|dd|d|�Sd|kr�dS|jdd�\}}y t|�}t|�d}Wntk
r*dSXt|||�rVt||||d|�SdS(s�Parses a range header into a
    :class:`~werkzeug.datastructures.ContentRange` object or `None` if
    parsing is not possible.

    .. versionadded:: 0.7

    :param value: a content range header to be parsed.
    :param on_update: an optional callable that is called every time a value
                      on the :class:`~werkzeug.datastructures.ContentRange`
                      object is changed.
    R0it/t*RtR�N(R=RyRQR�R�R�tContentRangetis_byte_range_valid(R6RtR�trangedefR�tlengthtstarttstop((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_content_range_header�s4(
	
cCs<d|krtd��nd|}|r8d|}n|S(siQuote an etag.

    :param etag: the etag to quote.
    :param weak: set to `True` to tag it "weak".
    R1sinvalid etags"%s"sW/(R�(tetagtweak((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt
quote_etag�s

cCs||s
dS|j�}t}|jd	�r>t}|d}n|d |dko]dknrr|dd!}n||fS(
s�Unquote a single etag:

    >>> unquote_etag('W/"bar"')
    ('bar', True)
    >>> unquote_etag('"bar"')
    ('bar', False)

    :param etag: the etag identifier to unquote.
    :return: a ``(etag, weak)`` tuple.
    sW/sw/iii����R1N(NN(sW/sw/(R=RyR_R�tTrue(R�R�((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyR�s
$c	Cs�|s
t�Sg}g}t|�}d}x�||kr�tj||�}|dkr\Pn|j�\}}}|dkr�tdt�S|r�|}n|r�|j|�n
|j|�|j�}q.Wt||�S(s�Parse an etag header.

    :param value: the tag header to parse
    :return: an :class:`~werkzeug.datastructures.ETags` object.
    iR�tstar_tagN(	tETagstlent_etag_reRXR=R[R�R>R^(	R6tstrongR�R^tposRXtis_weaktquotedtraw((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_etagss(
	
cCst|�j�S(sGenerate an etag for some data.(Rt	hexdigest(R*((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt
generate_etag7scCs�|r�t|j��}|dk	r�y�|d}|dkrV|dkrV|d7}n%|dkr{|dkr{|d7}nt|f|dd!�td	|d
p�d�SWq�ttfk
r�dSXq�ndS(s�Parse one of the following date formats into a datetime object:

    .. sourcecode:: text

        Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
        Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
        Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format

    If parsing fails the return value is `None`.

    :param value: a string with a supported date format.
    :return: a :class:`datetime.datetime` object.
    iiDi�iEiciliitsecondsi����N(RRyR=RRR�t
OverflowError(R6tttyear((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyR�<s


3cCs�|dkrt�}nBt|t�r6|j�}n$t|ttf�rZt|�}ndd|j|j|d|j	d||j
|j|j|j
f	S(s'Used for `http_date` and `cookie_date`.s%%s, %02d%s%s%s%04d %02d:%02d:%02d GMTtMontTuetWedtThutFritSattSuntJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDeciN(sMonsTuesWedsThusFrisSatsSun(sJansFebsMarsAprsMaysJunsJulsAugsSepsOctsNovsDec(R=RR'RtutctimetupleRRpttm_wdayttm_mdayttm_monttm_yearttm_hourttm_minttm_sec(tdtdelim((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt
_dump_date\s8
cCs
t|d�S(s�Formats the time to ensure compatibility with Netscape's cookie
    standard.

    Accepts a floating point number expressed in seconds since the epoch in, a
    datetime object or a timetuple.  All times in UTC.  The :func:`parse_date`
    function can be used to parse such a date.

    Outputs a string in the format ``Wdy, DD-Mon-YYYY HH:MM:SS GMT``.

    :param expires: If provided that date is used, otherwise the current.
    R�(R�(R((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytcookie_date~scCs
t|d�S(s�Formats the time to match the RFC1123 date format.

    Accepts a floating point number expressed in seconds since the epoch in, a
    datetime object or a timetuple.  All times in UTC.  The :func:`parse_date`
    function can be used to parse such a date.

    Outputs a string in the format ``Wdy, DD Mon YYYY HH:MM:SS GMT``.

    :param timestamp: If provided that date is used, otherwise the current.
    Rw(R�(t	timestamp((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt	http_date�scCsi|s
dSyt|�}Wntk
r.dSX|dkr?dSytd|�SWntk
rddSXdS(s�Parses a base-10 integer count of seconds into a timedelta.

    If parsing fails, the return value is `None`.

    :param value: a string consisting of an integer represented in base-10
    :return: a :class:`datetime.timedelta` object or `None`.
    iR�N(R=R�R�RR�(R6R�((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt	parse_age�s

cCsk|dkrdSt|t�r:|j|jdd}nt|�}|dkratd��nt|�S(s�Formats the duration as a base-10 integer.

    :param age: should be an integer number of seconds,
                a :class:`datetime.timedelta` object, or,
                if the age is unknown, `None` (default).
    Niiisage cannot be negative(R=R'RR�tdaysR�R�R-(tage((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytdump_age�sc	Cs�|d	kr'|d	k	r't|�}n|d	k	rBtd��nt}t|t�rft|�}n|d	k	r�|jdd�}nd	}|r�d|kr�t|j	d��}n|d	k	r�|j
d	k	r�|j
}nt|j	d��}|r|r||krt}n|r�t|�\}}|d	k	rc|j
d	k	rct|j
�j|�}q�t|j	d��}	|	r�|	j|�}nt|j	d��}
|
r�|
j|�}q�n|S(
s�Convenience method for conditional requests.

    :param environ: the WSGI environment of the request to be checked.
    :param etag: the etag for the response for comparison.
    :param data: or alternatively the data of the response to automatically
                 generate an etag using :func:`generate_etag`.
    :param last_modified: an optional date of the last modification.
    :param ignore_if_range: If `False`, `If-Range` header will be taken into
                            account.
    :return: `True` if the resource was modified, otherwise `False`.

    .. versionchanged:: 1.0.0
        The check is run for methods other than ``GET`` and ``HEAD``.
    sboth data and etag giventmicrosecondit
HTTP_RANGEt
HTTP_IF_RANGEtHTTP_IF_MODIFIED_SINCEtHTTP_IF_NONE_MATCHt
HTTP_IF_MATCHN(R=R�t	TypeErrorR_R'RR�R5R�R]R�R�R�R�R�tcontainst
contains_weakt	is_strong(tenvironR�R*t
last_modifiedtignore_if_ranget
unmodifiedtif_rangetmodified_sincet_t
if_none_matchtif_match((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytis_resource_modified�s8	cCs_td�|D��}g|D]7\}}t|�sH|j�|kr||f^q|(dS(sRemove all entity headers from a list or :class:`Headers` object.  This
    operation works in-place.  `Expires` and `Content-Location` headers are
    by default not removed.  The reason for this is :rfc:`2616` section
    10.3.5 which specifies some entity headers that should be sent.

    .. versionchanged:: 0.5
       added `allowed` parameter.

    :param headers: a list or :class:`Headers` object.
    :param allowed: a list of headers that should still be allowed even though
                    they are entity headers.
    css|]}|j�VqdS(N(R�(RJRH((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pys	<genexpr>sN(R3tis_entity_headerR�(theaderstallowedRCR6((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytremove_entity_headers
s
cCs6g|D]$\}}t|�s||f^q|(dS(s�Remove all HTTP/1.1 "Hop-by-Hop" headers from a list or
    :class:`Headers` object.  This operation works in-place.

    .. versionadded:: 0.5

    :param headers: a list or :class:`Headers` object.
    N(tis_hop_by_hop_header(RRCR6((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytremove_hop_by_hop_headerss	cCs|j�tkS(s�Check if a header is an entity header.

    .. versionadded:: 0.5

    :param header: the header to test.
    :return: `True` if it's an entity header, `False` otherwise.
    (R�t_entity_headers(R@((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyR,scCs|j�tkS(s�Check if a header is an HTTP/1.1 "Hop-by-Hop" header.

    .. versionadded:: 0.5

    :param header: the header to test.
    :return: `True` if it's an HTTP/1.1 "Hop-by-Hop" header, `False` otherwise.
    (R�t_hop_by_hop_headers(R@((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyR7sR5cs�t�t�r$�jdd��n�dkr9d�nt�t�r]�jdd��n|dkrrt}n���fd�}||��S(s]Parse a cookie from a string or WSGI environ.

    The same key can be provided multiple times, the values are stored
    in-order. The default :class:`MultiDict` will have the first value
    first, and all values can be retrieved with
    :meth:`MultiDict.getlist`.

    :param header: The cookie header as a string, or a WSGI environ dict
        with a ``HTTP_COOKIE`` key.
    :param charset: The charset for the cookie values.
    :param errors: The error behavior for the charset decoding.
    :param cls: A dict-like class to store the parsed cookies in.
        Defaults to :class:`MultiDict`.

    .. versionchanged:: 1.0.0
        Returns a :class:`MultiDict` instead of a
        ``TypeConversionDict``.

    .. versionchanged:: 0.5
       Returns a :class:`TypeConversionDict` instead of a regular dict.
       The ``cls`` parameter was added.
    tHTTP_COOKIER0RR5c3snxgt��D]Y\}}t|��dt�}|s=q
nt|��dt�}t|�|fVq
WdS(Ntallow_none_charset(R
RR�R(RCtval(tcharsetterrorsR@(s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt_parse_pairsfsN(R'RER]R=R	R)t	MultiDict(R@RRRRR
((RRR@s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytparse_cookieBs		R�i�cCs�t||�}t||�}|dk	rLddlm}|||�}nt|�}t|t�r�|jddd|j}n|dk	r�t|t	�s�t
|�}q�n.|dk	r�|	r�tt
t�|��}n|dk	r |j�}|dddhkr t
d��q n|d	t|�g}
xd
|tfd|tfd|tfd
|dfd|dfd|tfd|tffD]�\}}}|dkr�|r�|
j|�q�q�n|dkr�q�nt|�}t|ttf�stt|�|�}n|r)t|�}n|d	|7}|
jt|��q�Wdj|
�}tsu|jd�}nt|�}|
r�||
kr�t|�}tjdjd|d|d||d|d|
�dd�n|S(s�	Creates a new Set-Cookie header without the ``Set-Cookie`` prefix
    The parameters are the same as in the cookie Morsel object in the
    Python standard library but it accepts unicode data, too.

    On Python 3 the return value of this function will be a unicode
    string, on Python 2 it will be a native string.  In both cases the
    return value is usually restricted to ascii as the vast majority of
    values are properly escaped, but that is no guarantee.  If a unicode
    string is returned it's tunneled through latin1 as required by
    PEP 3333.

    The return value is not ASCII safe if the key contains unicode
    characters.  This is technically against the specification but
    happens in the wild.  It's strongly recommended to not use
    non-ASCII values for the keys.

    :param max_age: should be a number of seconds, or `None` (default) if
                    the cookie should last only as long as the client's
                    browser session.  Additionally `timedelta` objects
                    are accepted, too.
    :param expires: should be a `datetime` object or unix timestamp.
    :param path: limits the cookie to a given path, per default it will
                 span the whole domain.
    :param domain: Use this if you want to set a cross-domain cookie. For
                   example, ``domain=".example.com"`` will set a cookie
                   that is readable by the domain ``www.example.com``,
                   ``foo.example.com`` etc. Otherwise, a cookie will only
                   be readable by the domain that set it.
    :param secure: The cookie will only be available via HTTPS
    :param httponly: disallow JavaScript to access the cookie.  This is an
                     extension to the cookie standard and probably not
                     supported by all browsers.
    :param charset: the encoding for unicode values.
    :param sync_expires: automatically set expires if max_age is defined
                         but expires not.
    :param max_size: Warn if the final header value exceeds this size. The
        default, 4093, should be safely `supported by most browsers
        <cookie_>`_. Set to 0 to disable this check.
    :param samesite: Limits the scope of the cookie such that it will
        only be attached to requests if those requests are same-site.

    .. _`cookie`: http://browsercookielimits.squawky.net/

    .. versionchanged:: 1.0.0
        The string ``'None'`` is accepted for ``samesite``.
    i(t
iri_to_urii<itStricttLaxR=s,SameSite must be 'Strict', 'Lax', or 'None'.RPtDomaintExpiressMax-AgetSecuretHttpOnlytPathtSameSites; Rs�The "{key}" cookie is too large: the value was {value_size} bytes but the header required {extra_size} extra bytes. The final size was {cookie_size} bytes but the limit is {max_size} bytes. Browsers may silently ignore cookies larger than this.RCt
value_sizet
extra_sizetcookie_sizetmax_sizet
stackleveliN(R
R=turlsRRR'RR�R�RR�RttitleR�RR�R_R>t	bytearrayR(R	R?RR.R�twarningstwarntformat(RCR6tmax_ageRtpathtdomaintsecurethttponlyRtsync_expiresRtsamesiteRtbuftktvtqttmptrvRR((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pytdump_cookieqsl<	
	
cCs�|dk|dkkrtS|dkr>|dkp=|dkS|dkrbd|ko_|kSS||krrtSd|ko�|kSS(scChecks if a given byte content range is valid for the given length.

    .. versionadded:: 0.7
    iN(R=R_(R�R�R�((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyR�s(Rk(R�(R�(Rx(R�(R}(R�(R(R�(Rs(R�(sexpiresscontent-location(gt__doc__R�treR!RRthashlibRRRt_compatRRRRR	R
RRt	_internalR
RRtemail.utilsRtImportErrortemail.Utilsturllib.requestRRLturllib.parseRR\turllib2Rt_cookie_charsetR�tcompiletVERBOSERlt	frozensetR2R�R3t_unsafe_header_charsRZRWRRtHTTP_STATUS_CODESR+R/R�R:R_R<RDRIRKRORERTRjR=RrRuR|R~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRRRRR1R�tdatastructuresRkR�R�RxR�R}R�RR�RsR�(((s1/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/http.pyt<module>sr

	
				
	)H!	(	4-				 	"C	
		1�	

https://t.me/AnonymousX5 - 2025