Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/werkzeug/__pycache__/http.cpython-37.pyc

556 lines
33 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>/<2F>]<5D><><00>:@s6dZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlmZdd l
m Z dd
l
m Z dd l
m Z dd l
mZdd l
mZddl
mZddl
mZddl
mZddlmZddlmZddlmZyddlmZWn"ek
<EFBFBD>rddlmZYnXyddlmZddlmZ Wn.ek
<EFBFBD>rZddl!mZddl!m"Z YnXdZ#dZ$e<02>%dej&<26>Z'e(d<1B>Z)e<02>%d<1C>Z*e+d<1D>Z,ej%dej&d<1F>Z-e<02>%d <20>Z.e(d!d"d#d$d%d&d'd(d)d*g
<EFBFBD>Z/e(d+d,d-d.d/d0d1d2g<08>Z0d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdl<64>9Z1dmdn<64>Z2dodp<64>Z3d<33>dsdt<64>Z4d<34>dvdw<64>Z5dxdy<64>Z6d<36>dzd{<7B>Z7d|d}<7D>Z8e9fd~d<64>Z:d<>d<EFBFBD>d<EFBFBD><64>Z;d<>d<EFBFBD>d<EFBFBD><64>Z<d<>d<EFBFBD>d<EFBFBD><64>Z=d<>d<EFBFBD>d<EFBFBD><64>Z>d<>d<EFBFBD><64>Z?d<>d<EFBFBD>d<EFBFBD><64>Z@d<>d<EFBFBD><64>ZAd<41>d<EFBFBD>d<EFBFBD><64>ZBd<42>d<EFBFBD>d<EFBFBD><64>ZCd<43>d<EFBFBD>d<EFBFBD><64>ZDd<44>d<EFBFBD><64>ZEd<45>d<EFBFBD><64>ZFd<46>d<EFBFBD><64>ZGd<47>d<EFBFBD><64>ZHd<48>d<EFBFBD><64>ZId<49>d<EFBFBD>d<EFBFBD><64>ZJd<4A>d<EFBFBD>d<EFBFBD><64>ZKd<4B>d<EFBFBD>d<EFBFBD><64>ZLd<4C>d<EFBFBD>d<EFBFBD><64>ZMd<4D>d<EFBFBD>d<EFBFBD><64>ZNd<4E>d<EFBFBD>d<EFBFBD><64>ZOd<4F>d<EFBFBD><64>ZPd<50>d<EFBFBD><64>ZQd<51>d<EFBFBD><64>ZRd<52>d<EFBFBD>d<EFBFBD><64>ZSd<53>d<EFBFBD>d<EFBFBD><64>ZTd<54>d<EFBFBD><64>ZUdd<>lVmWZWdd<>lVmXZXdd<>lVmYZYdd<>lVmZZZdd<>lVm[Z[dd<>lVm\Z\dd<>lVm]Z]dd<>lVm^Z^dd<>lVm_Z_dd<>lVm`Z`dd<>lambZbebecd<63>d<EFBFBD>d<EFBFBD>d<EFBFBD>d<EFBFBD>gi[bdS)<29>a"
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
<EFBFBD>N)<01>datetime)<01> timedelta)<01>md5)<01>gmtime)<01>time<6D>)<01> integer_types)<01> iteritems)<01>PY2)<01> string_types)<01> text_type)<01>to_bytes)<01>
to_unicode)<01>try_coerce_native)<01>_cookie_parse_impl)<01> _cookie_quote)<01>_make_cookie_domain)<01> parsedate_tz)<01>parse_http_list)<01>unquote_to_bytes)<01>unquote<74>latin1<6E>utf-8a<38>
( # 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
zM!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~z&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$)z()<>@,;:"/[]?={} a<>
;\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*
)<01>flagsz,\s*([^;,\s]+)([;,]\s*.+)?Zallowzcontent-encodingzcontent-languagezcontent-lengthzcontent-locationz content-md5z content-rangez content-type<70>expiresz last-modified<65>
connectionz
keep-alivezproxy-authenticatezproxy-authorization<6F>te<74>trailerztransfer-encoding<6E>upgrade<64>ContinuezSwitching Protocols<6C>
Processing<EFBFBD>OK<4F>Created<65>AcceptedzNon Authoritative Informationz
No Contentz Reset ContentzPartial Contentz Multi StatuszIM UsedzMultiple ChoiceszMoved Permanently<6C>Foundz See Otherz Not Modifiedz Use ProxyzTemporary RedirectzPermanent Redirectz Bad Request<73> UnauthorizedzPayment Required<65> Forbiddenz Not FoundzMethod Not AllowedzNot AcceptablezProxy Authentication RequiredzRequest Timeout<75>Conflict<63>GonezLength RequiredzPrecondition FailedzRequest Entity Too LargezRequest URI Too LongzUnsupported Media TypezRequested Range Not SatisfiablezExpectation Failedz I'm a teapotzMisdirected RequestzUnprocessable Entity<74>LockedzFailed DependencyzUpgrade RequiredzPrecondition RequiredzToo Many RequestszRequest Header Fields Too Largez
Retry WithzUnavailable For Legal ReasonszInternal Server ErrorzNot Implementedz Bad GatewayzService UnavailablezGateway TimeoutzHTTP Version Not SupportedzInsufficient Storagez Not Extended)9<>d<00>e<00>f<00><><00><><00><><00><><00><><00><><00><><00><><00><>i,i-i.i/i0i1i3i4i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>i<>cCst|t<01>r|S|<00>d<01>S)z2coerce wsgi unicode represented bytes to real onesr)<03>
isinstance<EFBFBD>bytes<65>encode)<01>data<74>r:<00>3/tmp/pip-install-c3kgu56x/Werkzeug/werkzeug/http.py<70> wsgi_to_bytes<65>s
r<cCs.t|t<01>std<01><01>t|t<03>r |S|<00>d<02>SdS)Nzdata must be bytesr)r6r7<00>AssertionError<6F>str<74>decode)r9r:r:r;<00> bytes_to_wsgi<67>s
r@<00>TcCsTt|t<01>rt|<00>}t|<00>}|r<tt|<01>B}t|<00><01>|<03>r<|Sd|<00>dd<03><02>dd<05>S)aQuote 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.
z"%s"<22>\z\\<5C>"z\")r6r7r@r><00> _token_chars<72>set<65>issubset<65>replace)<04>valueZ extra_chars<72> allow_tokenZ token_charsr:r:r;<00>quote_header_value<75>s
 rJFcCs\|rX|d|dkr dkrXnn4|dd<02>}|rD|dd<06>dkrX|<00>dd<08><02>d d<03>S|S)
z<EFBFBD>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.
r<00><><EFBFBD><EFBFBD><EFBFBD>rCrN<>z\\rBz\")rG)rH<00> is_filenamer:r:r;<00>unquote_header_value<75>s
$ rNcCs`g}|dk r|<02>|<00>x>t|<01>D]2\}}|dkr<|<02>|<03>q |<02>d|t|<04>f<00>q Wd<03>|<02>S)z<>The reverse function to :func:`parse_options_header`.
:param header: the header to dump
:param options: a dict of options to append.
Nz%s=%sz; )<04>appendr rJ<00>join)<05>header<65>options<6E>segments<74>keyrHr:r:r;<00>dump_options_headers
 rUc spt|t<01>rTg}xVt|<00>D]6\}}|dkr4|<02>|<03>q|<02>d|t|<04>d<03>f<00>qWn<12>fdd<05>|D<00>}d<06>|<02>S)aJDump 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.
Nz%s=%s)rIcsg|]}t|<01>d<00><02>qS))rI)rJ)<02>.0<EFBFBD>x)rIr:r;<00>
<listcomp>/szdump_header.<locals>.<listcomp>z, )r6<00>dictr rOrJrP)<05>iterablerI<00>itemsrTrHr:)rIr;<00> dump_headers
 r\cCs\g}xRt|<00>D]F}|dd<02>|dd<01>kr6dkrJnnt|dd<03><00>}|<01>|<02>qW|S)a<>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`
NrrKrC)<03>_parse_list_headerrNrO)rH<00>result<6C>itemr:r:r;<00>parse_list_header3s (r`cCs<>|<01>}t|t<01>st|<00>}xrt|<00>D]f}d|kr8d||<q"|<03>dd<03>\}}|dd<03>|dd<02>krldkr<>nnt|dd<04><00>}|||<q"W|S)aKParse 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`
<20>=NrrKrC)r6r r@r]<00>splitrN)rH<00>clsr^r_<00>namer:r:r;<00>parse_dict_headerQs
( rec Cs@|s difSg}d|<00>dd<02>}<00>x|<00>r(t<01>|<00>}|s:P|<02>|<03>d<04><01>i}|<03>d<05>}d}x<>|<05>rt<05>|<05>}|stP|<07><06>\}} }
} } | s<>d}n |
s<EFBFBD>|}
|
}t|<08>}| dk r<>t| |dk<02>} |
dk r<>t| <0C><01> |
<EFBFBD>} | r<>|<04>
|d<01>| ||<n| ||<||<07> <0B>d<06>}q^W|<02>|<04>|dk<08>r"t |<02>S|}q$W|<02>r8t |<02>SdifS) u<>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
rA<00>,<2C>
rrLN<>filenameF) rG<00>_option_header_start_mime_type<70>matchrO<00>group<75>_option_header_piece_re<72>groupsrN<00>_unquoter?<00>get<65>end<6E>tuple) rH<00>multipler^rjrR<00>restZcontinued_encodingZoptmatch<63>option<6F>count<6E>encoding<6E>languageZ option_valuer:r:r;<00>parse_options_headerzsH





rxcCst|dkr t}|s|d<01>Sg}xNt<01>|<00>D]@}|<03>d<02>}|s@d}nttt|<04>d<03>d<04>}|<02>|<03>d<03>|f<02>q(W||<02>S)a<>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`.
NrLrr)<08>Accept<70>
_accept_re<EFBFBD>finditerrk<00>max<61>min<69>floatrO)rHrcr^rjZqualityr:r:r;<00>parse_accept_header<65>s
rcCs(|dkr t}|s|d|<01>S|t|<00>|<01>S)aParse 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)<02>RequestCacheControlre)rH<00> on_updatercr:r:r;<00>parse_cache_control_header<65>s

r<>cCs|std|<01>Stt|<00>|<01>S)aParse 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)<02> HeaderSetr`)rHr<>r:r:r;<00>parse_set_header<65>s
r<>cCs<>|sdSt|<00>}y|<00>dd<02>\}}|<01><02>}Wntk
r@dSX|dkr<>yt<04>|<02><01>dd<02>\}}Wntk
rxdSXtdt|t <09>t|t <09>d<06><02>S|dkr<>t
|<02>}xdD]}||kr<>dSq<>Wd |kr<>|<05> d
<EFBFBD>r<>|<05> d <0B>s<>dStd |<05>SdS) awParse 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`.
Nrsbasic<69>:<3A>basic)<02>username<6D>passwordsdigest)r<><00>realm<6C>nonce<63>uri<72>response<73>qop<6F>nc<6E>cnonce<63>digest) r<rb<00>lower<65>
ValueError<EFBFBD>base64<36> b64decode<64> Exception<6F> Authorizationr<00>_basic_auth_charsetrero)rH<00> auth_type<70> auth_infor<6F>r<>Zauth_maprTr:r:r;<00>parse_authorization_headers4  
r<>c Csd|st|d<01>Sy|<00>dd<03>\}}|<02><02>}Wn(ttfk
rRt|<00><05><00><02>|d<01>SXt|t|<03>|<01>S)a<>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.
)r<>Nr)<07>WWWAuthenticaterbr<>r<><00>AttributeError<6F>stripre)rHr<>r<>r<>r:r:r;<00>parse_www_authenticate_headerAs

 r<>cCs4|s
t<00>St|<00>}|dk r$t|d<02>Stt|<00>d<00>S)z<>Parses an if-range header which can be an etag or a date. Returns
a :class:`~werkzeug.datastructures.IfRange` object.
.. versionadded:: 0.7
N)<01>dater)<03>IfRange<67>
parse_date<EFBFBD> unquote_etag)rHr<>r:r:r;<00>parse_if_range_headerUs 
r<>c CsB|r d|krdSg}d}|<00>dd<04>\}}|<04><01><00><02>}<04>x|<05>d<05>D]<5D>}|<06><01>}d|krZdS|<06>d<06>r<>|dkrpdSy t|<06>}Wntk
r<EFBFBD>dSXd}d}n<>d|k<06>r&|<06>dd<04>\}}|<07><01>}|<08><01>}|<07><06>s<>dSt|<07>}||ks<>|dkr<>dS|<08>r|<08><06><00>sdSt|<08>d}||k<05>r"dSnd}|}|<02>||f<02>qBWt||<02>S)aParses 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
raNrrrf<00>-rK) rbr<>r<><00>
startswith<EFBFBD>intr<74><00>isdigitrO<00>Range) rHZmake_inclusive<76>rangesZlast_end<6E>units<74>rngr_<00>beginrpr:r:r;<00>parse_range_headerdsL  
 

 
r<>cCs|dkr dSy|pd<02><00><00>dd<03>\}}Wntk
r<dSXd|krJdS|<03>dd<03>\}}|dkrhd}n|<05><03>rzt|<05>}ndS|dkr<>t|dd||d<06>Sd|kr<>dS|<04>dd<03>\}}yt|<06>}t|<07>d}Wntk
r<EFBFBD>dSXt|||<05><03>rt|||||d<06>SdS)a<>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.
NrAr<00>/<2F>*)r<>r<>)r<>rbr<>r<>r<><00> ContentRange<67>is_byte_range_valid)rHr<>r<>Zrangedefr<66><00>length<74>start<72>stopr:r:r;<00>parse_content_range_header<65>s4 
r<>cCs(d|krtd<02><01>d|}|r$d|}|S)ziQuote an etag.
:param etag: the etag to quote.
:param weak: set to `True` to tag it "weak".
rCz invalid etagz"%s"zW/)r<>)<02>etag<61>weakr:r:r;<00>
quote_etag<EFBFBD>s r<>cCsj|sdS|<00><00>}d}|<00>d<03>r.d}|dd<06>}|dd<07>|dd<06>krRd krbnn |dd<08>}||fS)
z<EFBFBD>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.
)NNF)zW/zw/TrLNrrKrC)r<>r<>)r<>r<>r:r:r;r<><00>s 
 ( r<>c Cs<>|s
t<00>Sg}g}t|<00>}d}xl||kr<>t<02>||<04>}|dkr>P|<05><04>\}}}|dkr^tdd<05>S|rf|}|rv|<02>|<08>n
|<01>|<08>|<05><06>}q Wt||<02>S)z<>Parse an etag header.
:param value: the tag header to parse
:return: an :class:`~werkzeug.datastructures.ETags` object.
rNr<4E>T)Zstar_tag)<07>ETags<67>len<65>_etag_rerjrmrOrp) rH<00>strongr<67>rp<00>posrjZis_weak<61>quoted<65>rawr:r:r;<00> parse_etags<67>s(
 
 
 r<>cCs t|<00><01><01>S)zGenerate an etag for some data.)r<00> hexdigest)r9r:r:r;<00> generate_etagsr<>c Cs<>|r<>t|<00><01><00>}|dk r<>yb|d}|dkr<|dkr<|d7}n|dkrT|dkrT|d7}t|f|dd <09><00>t|d
ptdd <0B>Sttfk
r<EFBFBD>dSXdS) a<>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.
Nr<00>Di<><00>E<00>cilr<00>rK)<01>seconds)rr<>rrr<><00> OverflowError)rH<00>t<>yearr:r:r;r<> s 
(r<>c
Csr|dkrt<00>}n*t|t<02>r$|<00><03>}nt|ttf<02>r:t|<00>}dd|j|j|d|jd|t |j
<EFBFBD>|j |j |j f S)z'Used for `http_date` and `cookie_date`.Nz#%s, %02d%s%s%s%s %02d:%02d:%02d GMT)<07>Mon<6F>Tue<75>Wed<65>Thu<68>Fri<72>Sat<61>Sun) <0C>Jan<61>Feb<65>Mar<61>Apr<70>May<61>Jun<75>Jul<75>Aug<75>Sep<65>Oct<63>Nov<6F>Decr)rr6r<00> utctimetuplerr~<00>tm_wday<61>tm_mday<61>tm_monr><00>tm_year<61>tm_hour<75>tm_min<69>tm_sec)<02>d<>delimr:r:r;<00>
_dump_date,s"


r<>cCs
t|d<01>S)a<>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<>)rr:r:r;<00> cookie_dateNs r<>cCs
t|d<01>S)a<>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.
<20> )r<>)<01> timestampr:r:r;<00> http_date]s r<>cCsZ|sdSy t|<00>}Wntk
r(dSX|dkr6dSy
t|d<03>Stk
rTdSXdS)z<>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`.
Nr)r<>)r<>r<>rr<>)rHr<>r:r:r;<00> parse_ageks 
r<>cCsJ|dkr dSt|t<01>r*|j|jdd}t|<00>}|dkrBtd<05><01>t|<00>S)z<>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).
N<>irzage cannot be negative)r6rr<><00>daysr<73>r<>r>)Zager:r:r;<00>dump_age<67>s
r<>c Cs8|dkr|dk rt|<02>}n|dk r*td<02><01>|ddkr:dSd}t|t<03>rPt|<03>}|dk rd|jdd<07>}d}|s<>d|kr<>t|<00>d <09><01>}|dk r<>|jdk r<>|j}nt|<00>d
<EFBFBD><01>}|r<>|r<>||kr<>d }|<01>r2t |<01>\}}|dk r<>|j
dk r<>t |j
<EFBFBD><01> |<01>}n>t |<00>d <0C><01>} | <09>r| <09> |<01>}t |<00>d <0A><01>}
|
<EFBFBD>r2|
<EFBFBD>|<01> }| S)a;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`.
Nzboth data and etag given<65>REQUEST_METHOD)<02>GET<45>HEADFr)<01> microsecondZ
HTTP_RANGEZ HTTP_IF_RANGEZHTTP_IF_MODIFIED_SINCETZHTTP_IF_NONE_MATCHZ HTTP_IF_MATCH)r<><00> TypeErrorr6r r<>rGr<>ror<>r<>r<>r<><00>containsZ contains_weakZ is_strong) <0B>environr<6E>r9Z last_modifiedZignore_if_rangeZ
unmodifiedZif_rangeZmodified_since<63>_Z if_none_matchZif_matchr:r:r;<00>is_resource_modified<65>s<
 
   
 r<><00>rzcontent-locationcs0tdd<02><00>D<00><01><01><00>fdd<04>|D<00>|dd<05><dS)aRemove 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|]}|<01><00>VqdS)N)r<>)rVrWr:r:r;<00> <genexpr><3E>sz(remove_entity_headers.<locals>.<genexpr>cs,g|]$\}}t|<01>r |<01><01><00>kr||f<02>qSr:)<02>is_entity_headerr<72>)rVrTrH)<01>allowedr:r;rX<00>sz)remove_entity_headers.<locals>.<listcomp>N)rE)<02>headersr<73>r:)r<>r;<00>remove_entity_headers<72>s 
r<>cCsdd<02>|D<00>|dd<03><dS)z<>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.
cSs g|]\}}t|<01>s||f<02>qSr:)<01>is_hop_by_hop_header)rVrTrHr:r:r;rX<00>sz-remove_hop_by_hop_headers.<locals>.<listcomp>Nr:)r<>r:r:r;<00>remove_hop_by_hop_headers<72>s rcCs |<00><00>tkS)z<>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<><00>_entity_headers)rQr:r:r;r<><00>sr<>cCs |<00><00>tkS)z<>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<><00>_hop_by_hop_headers)rQr:r:r;rsrrGcs`t<00>t<01>r<18><02>dd<02><02>n <0C>dkr$d<02>t<00>t<03>r:<3A><02>dd<05><02>|dkrFt}<03><00><01>fdd<07>}||<04><00>S)aGParse a cookie. Either from a string or WSGI environ.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
:exc:`HTTPUnicodeError` is raised.
.. versionchanged:: 0.5
This function now returns a :class:`TypeConversionDict` instead of a
regular dict. The `cls` parameter was added.
:param header: the header to be used to parse the cookie. Alternatively
this can be a WSGI environment.
:param charset: the charset for the cookie values.
:param errors: the error behavior for the charset decoding.
:param cls: an optional dict class to use. If this is not specified
or `None` the default :class:`TypeConversionDict` is
used.
Z HTTP_COOKIErANrrGc3sNxHt<00><02>D]<\}}t|<00><00>dd<02>}|s(q
t|<01><00>dd<02>}t|<00>|fVq
WdS)NT)Zallow_none_charset)rrr)rT<00>val)<03>charset<65>errorsrQr:r;<00> _parse_pairs3s z"parse_cookie.<locals>._parse_pairs)r6rYror r8<00>TypeConversionDict)rQrrrcrr:)rrrQr;<00> parse_cookies

 r r<><00><>c  Cs<>t||<08>}t||<08>}|dk r2ddlm} | ||<08>}t|<05>}t|t<05>r\|jddd|j}|dk rxt|t<08>s<>t |<03>}n|dk r<>| r<>tt t
<EFBFBD>|<00><01>}| r<>| <0B> <0B>nd} | dkr<>t d<07><01>|dt |<01>g} x<>d |d
fd |d fd |d fd|dfd|dfd|d fd| d ffD]<5D>\}}}|dk<08>r.|<0F>r| <0A>|<0E><00>q|dk<08>r<<3C>qt|<0E>}t|ttf<02><02>sbtt|<0F>|<08>}|<10>rpt |<0F>}|d|7}| <0A>t|<11><01><00>qWd<12>| <0A>}t<13>s<>|<12>d<13>}t|<12>}|
<EFBFBD>r<>||
k<04>r<>t|<01>}tjdj||||||
d<15>dd<17>|S)aw 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/
Nr)<01>
iri_to_uri<EFBFBD><r<>)ZStrictZLaxNz7invalid SameSite value; must be 'Strict', 'Lax' or None<6E>=sDomainTsExpiresFsMax-AgesSecuresHttpOnlysPathsSameSites; rz<>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.)rT<00>
value_sizeZ
extra_size<EFBFBD> cookie_size<7A>max_sizerL)<01>
stacklevel)r <00>urlsr rr6rr<>r<>r r<>r<00>titler<65>rrO<00> bytearrayr7r rPr
r?r<><00>warnings<67>warn<72>format)rTrHZmax_ager<00>path<74>domain<69>secure<72>httponlyrZ sync_expiresrZsamesiter <00>buf<75>k<>v<>q<>tmp<6D>rvrrr:r:r;<00> dump_cookie>sj9

 



 


 

r"cCsp|dk|dkkrdS|dkr,|dkp*|dkS|dkrLd|koF|kSS||krXdSd|koj|kSS)zcChecks if a given byte content range is valid for the given length.
.. versionadded:: 0.7
NFrr:)r<>r<>r<>r:r:r;r<><00>sr<>)ry)r<>)r<>)r<>)r<>)r<>)r<>)r<>)r)r<>)<01>_DeprecatedImportModulez.datastructuresZ CharsetAcceptZHeadersZLanguageAcceptZ
MIMEAcceptz Werkzeug 1.0)rAT)F)T)F)N)NN)N)N)T)N)F)N)N)N)N)NNNT)r<>)rrGN) rANNr<4E>NFFrTr
N)d<>__doc__r<5F><00>rerrr<00>hashlibrrr<00>_compatrr r
r r r rr<00> _internalrrr<00> email.utilsr<00> ImportErrorZ email.Utils<6C>urllib.requestrr]<00> urllib.parserrn<00>urllib2rZ_cookie_charsetr<74><00>compile<6C>VERBOSErz<00> frozensetrDr<>rEZ_unsafe_header_charsrlrirrZHTTP_STATUS_CODESr<r@rJrNrUr\r`rYrerxrr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rr<>rr r"r<>Zdatastructuresryr<>r<>r<>r<>r<>r<>r<>rr<>Zwerkzeugr#<00>__name__r:r:r:r;<00><module>sh                  





 )
H
!

(

4
-
 "




B
  
/
~