Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/wsgiref/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/wsgiref/__pycache__/headers.cpython-311.pyc
�

�,dn��T�dZddlZejd��Zdd�ZGd�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[ \(\)<>@,;:\\"/\[\]\?=]�c���|�ht|��dkrU|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�|�eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zdd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�Headersz,Manage a collection of HTTP response headersNc���|�|ng}t|��turtd���||_	|D]/\}}|�|��|�|���0dS)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__s���$�0�'�'�b����=�=��$�$��I�J�J�J���
�	-��
-�
-���1��)�)�!�,�,�,��)�)�!�,�,�,�,�
-�
-rc��t|��tur|Std�t	|�������)zConvert/check value type.z1Header names/values must be of type str (got {0}))r�str�AssertionError�format�repr)rr
s  rrzHeaders._convert_string_type)sB����;�;�#����L��%�%+�V�D��K�K�%8�%8�:�:�	:rc�*�t|j��S)z9Return the total number of headers, including duplicates.)rr�rs r�__len__zHeaders.__len__0s���4�=�!�!�!rc��||=|j�|�|��|�|��f��dS)zSet the value of a header.N)r�appendr)r�name�vals   r�__setitem__zHeaders.__setitem__4sV����J��
���
�
&�
&�t�
,�
,�d�.G�.G��.L�.L�M�	O�	O�	O�	O�	Orc���|���������fd�|jD��|jdd�<dS)zyDelete all occurrences of a header, if present.

        Does *not* raise an exception if the header is missing.
        c�P��g|]"}|d����k� |��#S)r��lower��.0�kvr)s  �r�
<listcomp>z'Headers.__delitem__.<locals>.<listcomp>@s/���P�P�P�2�"�Q�%�+�+�-�-�4�:O�:O�B�:O�:O�:OrN�rr/r�rr)s `r�__delitem__zHeaders.__delitem__:sL���
�(�(������6�6��P�P�P�P���P�P�P��
�a�a�a���rc�,�|�|��S)aHGet 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.
        ��getr5s  r�__getitem__zHeaders.__getitem__Bs���x�x��~�~�rc�0�|�|��duS)z/Return true if the message contains the header.Nr8r5s  r�__contains__zHeaders.__contains__Ms���x�x��~�~�T�)�)rc�x��|���������fd�|jD��S)aqReturn 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.
        c�\��g|](}|d����k� |d��)S)rrr.r0s  �rr3z#Headers.get_all.<locals>.<listcomp>[s3���E�E�E�"��A�������1D�1D��1��1D�1D�1Drr4r5s `r�get_allzHeaders.get_allRs<����(�(������6�6��E�E�E�E��
�E�E�E�Erc��|�|�����}|jD]!\}}|���|kr|cS�"|S)z:Get the first header value for 'name', or return 'default'r4)rr)�defaultrrs     rr9zHeaders.get^sV���(�(������6�6���=�	�	�C�A�a��w�w�y�y�$���������rc�$�d�|jD��S)a*Return 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.
        c��g|]\}}|��S�rD�r1rrs   rr3z Headers.keys.<locals>.<listcomp>o���,�,�,�d�a���,�,�,r�rr%s r�keyszHeaders.keysg���-�,�d�m�,�,�,�,rc�$�d�|jD��S)a!Return 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.
        c��g|]\}}|��SrDrDrEs   rr3z"Headers.values.<locals>.<listcomp>yrFrrGr%s r�valueszHeaders.valuesqrIrc� �|jdd�S)aGet 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.
        NrGr%s r�itemsz
Headers.items{s���}�Q�Q�Q��rc�0�|jj�d|j�d�S)N�(�))�	__class__�__name__rr%s r�__repr__zHeaders.__repr__�s���>�2�2�2�D�M�M�M�B�Brc�T�d�d�|jD��ddgz��S)zkstr() returns the formatted headers, complete with end line,
        suitable for direct HTTP transmission.z
c��g|]}d|z��S)z%s: %srD)r1r2s  rr3z#Headers.__str__.<locals>.<listcomp>�s��B�B�B�b�H�r�M�B�B�Br�)�joinrr%s r�__str__zHeaders.__str__�s0���{�{�B�B�D�M�B�B�B�B�r�7�J�K�K�Krc�F�t|���d��S)Nz
iso-8859-1)r �encoder%s r�	__bytes__zHeaders.__bytes__�s���4�y�y����-�-�-rc��|�|��}|�D|j�|�|��|�|��f��|S|S)z�Return 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'.)r9rr(r)rr)r
�results    r�
setdefaultzHeaders.setdefault�sb��
���$�����>��M� � �$�";�";�D�"A�"A��)�)�%�0�0�"2�
3�
3�
3��L��Mrc	�4�g}|�*|�|��}|�|��|���D]�\}}|�|��}|�*|�|�dd�����F|�|��}|�t	|�dd��|������|j�|�|��d�|��f��dS)afExtended 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.
        N�_�-z; )rr(rNrrrrX)r�_name�_value�_params�partsrrs       r�
add_headerzHeaders.add_header�s�� �����.�.�v�6�6�F��L�L�� � � ��M�M�O�O�	C�	C�D�A�q��)�)�!�,�,�A��y����Q�Y�Y�s�C�0�0�1�1�1�1��-�-�a�0�0�����\�!�)�)�C��*=�*=�q�A�A�B�B�B�B��
���d�7�7��>�>��	�	�%�@P�@P�Q�R�R�R�R�Rr)N)rS�
__module__�__qualname__�__doc__rrr&r+r6r:r<r?r9rHrLrNrTrYr\r_rgrDrrrrs7������6�6�-�-�-�-�:�:�:�"�"�"�O�O�O�Q�Q�Q�	�	�	�*�*�*�
	F�	F�	F�����-�-�-�-�-�-� � � �C�C�C�L�L�L�
.�.�.����S�S�S�S�Srr)Nr)rj�re�compiler	rrrDrr�<module>rms�����
�	�	�	��B�J�2�3�3�	�����\S�\S�\S�\S�\S�\S�\S�\S�\S�\Sr

ZeroDay Forums Mini