*jSrSSKr\R"S5r\R"S5r\R"S5rS Sjr"SS5rg) zManage HTTP Response Headers Much of this module is red-handedly pilfered from email.message in the stdlib, so portions are Copyright (C) 2001,2002 Python Software Foundation, and were written by Barry Warsaw. Nz[ \(\)<>@,;:\\"/\[\]\?=]z[\x00-\x1F\x7F]z[\x00-\x08\x0A-\x1F\x7F]cUbe[U5S:aVU(d[RU5(a,URSS5RSS5nU<SU<S3$U<SU<3$U$)zvConvenience function to format and return a key=value pair. This will quote the value if needed or if quote is true. r\z\\"z\"z="=)len tspecialssearchreplace)paramvaluequotes 6/opt/alt/python313/lib64/python3.13/wsgiref/headers.py _formatparamrs_  SZ!^ I$$U++MM$/77UCE %u- -#U+ + c\rSrSrSrSSjrSrSrSrSr S r S r S r SS jr S rSrSrSrSrSrSrSrSrg)Headers!z,Manage a collection of HTTP response headersNcXUbUO/n[U5[La [S5eXlg)Nz+Headers must be a list of name/value tuples)typelist TypeError_headers_convert_string_type)selfheaderskvs r__init__Headers.__init__$s.$0'b = $IJ J rc[U5[La6U(a[O[nUR U5(a [ S5eU$[ SR[U555e)zConvert/check value type.z)Control characters not allowed in headersz1Header names/values must be of type str (got {0})) rstr_name_disallowed_re_value_disallowed_rer ValueErrorAssertionErrorformatrepr)rr nameregexs rrHeaders._convert_string_type.sY ;# ,0(6JE||E"" !LMML%%+VDK%8: :rc,[UR5$)z9Return the total number of headers, including duplicates.)rrrs r__len__Headers.__len__8s4==!!rczX URRURUSS9URUSS945 g)zSet the value of a header.Tr(FN)rappendr)rr(vals r __setitem__Headers.__setitem__<sD J   & &t$ & 79R9RSV]b9R9c d frcURUR5SS9nURVs/sHo"SR5U:wdMUPM snURSS&gs snf)ziDelete all occurrences of a header, if present. Does *not* raise an exception if the header is missing. Tr0rNrlowerrrr(kvs r __delitem__Headers.__delitem__BsR ((D(A)-P2Q%++-4:OBP aPs A" A"c$URU5$)a Get the first header value for 'name' Return None if the header is missing instead of raising an exception. Note that if the header appeared multiple times, the first exactly which occurrence gets returned is undefined. Use getall() to get all the values matching a header field name. getrr(s r __getitem__Headers.__getitem__Jsxx~rc(URU5SL$)z/Return true if the message contains the header.Nr=r?s r __contains__Headers.__contains__Usxx~T))rcURUR5SS9nURVs/sH o"SR5U:XdMUSPM" sn$s snf)aIReturn a list of all the values for the named field. These will be sorted in the order they appeared in the original header list or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. If no fields exist with the given name, returns an empty list. Tr0rr6r8s rget_allHeaders.get_allZsP((D(A $ E "A1D1 EEEs A AcURUR5SS9nURHup4UR5U:XdMUs $ U$)z:Get the first header value for 'name', or return 'default'Tr0r6)rr(defaultrrs rr> Headers.getfsF((D(A==CAwwy$!rcPURVVs/sHupUPM snn$s snnf)aReturn a list of all the header field names. These will be sorted in the order they appeared in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. rrrrs rkeys Headers.keyso"#mm,mdam,,,"cPURVVs/sHupUPM snn$s snnf)zReturn a list of all header values. These will be sorted in the order they appeared in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. rMrNs rvaluesHeaders.valuesyrQrRc URSS$)zGet all the header fields and values. These will be sorted in the order they were in the original header list, or were added to this instance, and may contain duplicates. Any fields deleted and re-inserted are always appended to the header list. NrMr,s ritems Headers.itemss}}QrcRURR<SUR<S3$)N()) __class____name__rr,s r__repr__Headers.__repr__s>>22DMMBBrctSRURVs/sHnSU-PM snSS/-5$s snf)zcstr() returns the formatted headers, complete with end line, suitable for direct HTTP transmission.z z%s: %s)joinr)rr9s r__str__Headers.__str__s6{{DMMBMbHrMMBBr7JKKBs5c6[U5RS5$)Nz iso-8859-1)r!encoder,s r __bytes__Headers.__bytes__s4y --rcURU5nUc;URRURUSS9URUSS945 U$U$)zReturn first matching header value for 'name', or 'value' If there is no header named 'name', add a new header with name 'name' and value 'value'.Tr0F)r>rr1r)rr(r results r setdefaultHeaders.setdefaults\ $ > MM $";";Dt";"L))%e)<"> ?LMrc /nUb!URUSS9nURU5 UR5HvupVURUSS9nUc#URURSS55 M;URUSS9nUR[ URSS5U55 Mx UR RURUSS9SR U545 g)aExtended header setting. _name is the header field to add. keyword arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as key="value" unless value is None, in which case only the key will be added. Example: h.add_header('content-disposition', 'attachment', filename='bud.gif') Note that unlike the corresponding 'email.message' method, this does *not* handle '(charset, language, value)' tuples: all values must be strings or None. NFr0T_-z; )rr1rWr rrrb)r_name_value_paramspartsrrs r add_headerHeaders.add_headers   ..vE.BF LL MMODA))!$)7Ay QYYsC01--ae-< \!))C*=qAB $ d77D7I499UZK[\]rrM)N)r] __module__ __qualname____firstlineno____doc__rrr-r3r:r@rCrGr>rOrTrWr^rcrgrkrt__static_attributes__rrrr!s`69:"f Q * F-- CL . ^rr)NrF)ryrecompilerr"r#rrr{rrr~sS JJ2 3 jj!34zz"=> _^_^r