*j S r SSKr\R " S5 r\R " S5 r\R " S5 rS S jr " S S5 rg) 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]c Ube [ U5 S: aV U( d [ R U5 ( a, UR SS5 R SS5 nU < 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_formatparamr s_ SZ!^I$$U++MM$/77UCE %u--#U++ c \ rS rSrSrSS jrS rS rS rS r S r S rS rSS jr S rS rS rS rS rS rS rS rSrg)Headers! z,Manage a collection of HTTP response headersNc X Ub UO/ n[ U5 [ La [ S5 eXl g )Nz+Headers must be a list of name/value tuples)typelist TypeError_headers_convert_string_type)selfheaderskvs r __init__Headers.__init__$ s. $0'b=$IJJ r c [ U5 [ L a6 U( a [ O[ nUR U5 ( a [ S5 eU$ [ SR [ U5 5 5 e)zConvert/check value type.z)Control characters not allowed in headersz1Header names/values must be of type str (got {0})) r str_name_disallowed_re_value_disallowed_rer ValueErrorAssertionErrorformatrepr)r r nameregexs r r Headers._convert_string_type. sY ;#,0(6JE||E"" !LMML %%+VDK%8: :r c , [ U R 5 $ )z9Return the total number of headers, including duplicates.)r r r s r __len__Headers.__len__8 s 4==!!r c z X U R R U R USS9U R USS945 g)zSet the value of a header.Tr( FN)r appendr )r r( vals r __setitem__Headers.__setitem__<