PATH:
opt
/
alt
/
python311
/
lib64
/
python3.11
/
wsgiref
/
__pycache__
� �0�i� � � � d Z ddlZ ej d� � Z ej d� � Z ej d� � Zd d�Z G d� d � � ZdS )z�Manage 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 �� � |�ht |� � dk rU|st � |� � r2|� dd� � � dd� � }| �d|�d�S | �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� tspecials�search�replace)�param�value�quotes �6/opt/alt/python311/lib64/python3.11/wsgiref/headers.py�_formatparamr s� � � ��S��Z�Z�!�^�^�� ,�I�$�$�U�+�+� ,��M�M�$��/�/�7�7��U�C�C�E� %���u�u�u�-�-�#�e�e�U�U�+�+��� c �| � e Zd ZdZdd�Zd� Zd� Zd� Zd� Zd� Z d � Z d � Zdd�Zd� Z d � Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�Headersz,Manage a collection of HTTP response headersNc �j � |�|ng }t |� � t urt d� � �|| _ d S )Nz+Headers must be a list of name/value tuples)�type�list� TypeError�_headers�_convert_string_type)�self�headers�k�vs r �__init__zHeaders.__init__$ sA � �$�0�'�'�b����=�=��$�$��I�J�J�J��� � 9� 9r c � � t |� � t u r6|rt nt }|� |� � rt d� � �|S t d� t |� � � � � � �)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 � ValueError�AssertionError�format�repr)r r �name�regexs r r zHeaders._convert_string_type. sw � ���;�;�#���,0�J�(�(�6J�E��|�|�E�"�"� N� �!L�M�M�M��L�� %�%+�V�D��K�K�%8�%8�:� :� :r c �* � t | j � � S )z9Return the total number of headers, including duplicates.)r r �r s r �__len__zHeaders.__len__8 s � ��4�=�!�!�!r c � � | |= | j � | � |d�� � | � |d�� � f� � dS )zSet the value of a header.T�r'