Viewing File: /opt/alt/python-internal/lib64/python3.11/wsgiref/__pycache__/headers.cpython-311.pyc
!A?hn T d Z ddlZ ej d ZddZ G d d ZdS ) 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[ \(\)<>@,;:\\"/\[\]\?=] c |ht | dk rU|st | r2| dd dd }| d|dS | d|S | S ) z~Convenience function to format and return a key=value pair.
This will quote the value if needed or if quote is true.
Nr \z\\"z\"z="=)len tspecialssearchreplace)paramvaluequotes </opt/alt/python-internal/lib64/python3.11/wsgiref/headers.py_formatparamr
s
SZZ!^^ ,I$$U++ ,MM$//77UCCE %uuu--#eeUU++ c | e Zd ZdZddZd Zd Zd Zd Zd Z d Z
d
ZddZd Z
d
Zd Zd Zd Zd Zd Zd ZdS )Headersz,Manage a collection of HTTP response headersNc ||ng }t | t urt d || _ |D ]/\ }}| | | | 0d S )Nz+Headers must be a list of name/value tuples)typelist TypeError_headers_convert_string_type)selfheaderskvs r __init__zHeaders.__init__ s $0''b==$$IJJJ
-
-
-1))!,,,))!,,,,
-
-r c t | t u r|S t d t | )zConvert/check value type.z1Header names/values must be of type str (got {0}))r strAssertionErrorformatrepr)r r
s r r zHeaders._convert_string_type) sB ;;#L %%+VDKK%8%8: : :r c * t | j S )z9Return the total number of headers, including duplicates.)r r r s r __len__zHeaders.__len__0 s 4=!!!r c | |= | j | | | | f dS )zSet the value of a header.N)r appendr )r namevals r __setitem__zHeaders.__setitem__4 sV J
&
&t
,
,d.G.G.L.LM O O O O Or c | fd| j D | j dd<