Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/web/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/web/__pycache__/vhost.cpython-310.pyc
o

5�@g��@s�dZzddlmZWneyddlmZYnwddlmZddlm	Z	Gdd�dej
�ZGdd�de	j�Z
Gd	d
�d
e	j�ZGdd�de	j�Zd
S)z&
I am a virtual hosts implementation.
�)�escape)�roots)�resourcec@s>eZdZdZejZdd�Zdd�Zdd�Z	dd	�Z
d
d�ZdS)
�VirtualHostCollectionzWWrapper for virtual hosts collection.

    This exists for configuration purposes.
    cCs
||_dS�N)�nvh)�selfr�r	�3/usr/lib/python3/dist-packages/twisted/web/vhost.py�__init__s
zVirtualHostCollection.__init__cCs|jj��Sr)r�hosts�items�rr	r	r
�listStaticEntitiessz(VirtualHostCollection.listStaticEntitiescCs|jj�|�Sr)rr�get�r�namer	r	r
�getStaticEntity"sz%VirtualHostCollection.getStaticEntitycCs|j�||�dSr)r�addHost)rr�entityr	r	r
�reallyPutEntity%sz%VirtualHostCollection.reallyPutEntitycCs|j�|�dSr)r�
removeHostrr	r	r
�	delEntity(szVirtualHostCollection.delEntityN)�__name__�
__module__�__qualname__�__doc__r�Resource�
entityTyperrrrrr	r	r	r
rsrc@sTeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�NameVirtualHostz5I am a resource which represents named virtual hosts.NcCstj�|�i|_dS)zInitialize.N)rrrrrr	r	r
r1s
zNameVirtualHost.__init__cCstj�|�dt|�fgS�Nz
Virtual Hosts)rrrrrr	r	r
r6s

�z"NameVirtualHost.listStaticEntitiescCs|dkrt|�Stj�||�Sr )rrrrrr	r	r
r;szNameVirtualHost.getStaticEntitycCs||j|<dS)a�Add a host to this virtual host.

        This will take a host named `name', and map it to a resource
        `resrc'.  For example, a setup for our virtual hosts would be::

            nvh.addHost('divunal.com', divunalDirectory)
            nvh.addHost('www.divunal.com', divunalDirectory)
            nvh.addHost('twistedmatrix.com', twistedMatrixDirectory)
            nvh.addHost('www.twistedmatrix.com', twistedMatrixDirectory)
        N�r)rr�resrcr	r	r
rAszNameVirtualHost.addHostcCs|j|=dS)zRemove a host.Nr!rr	r	r
rNszNameVirtualHost.removeHostcCsZ|�d�}|dkr|jpt��S|���dd�d}|j�||j�p,t�dtt	|���S)z;(Internal) Get the appropriate resource for the given host.shostN�:�rzhost %s not in vhost map)
�	getHeader�defaultr�
NoResource�lower�splitrr�html_escape�repr)r�request�
hostHeader�hostr	r	r
�_getResourceForRequestRs
�z&NameVirtualHost._getResourceForRequestcCs|�|�}|�|�S)z4Implementation of resource.Resource's render method.)r/�render)rr,r"r	r	r
r0]s

zNameVirtualHost.rendercCs6|�|�}|jr|j�d|j�d��|S|�||�S)z6Implementation of resource.Resource's getChild method.r���)r/�isLeaf�postpath�insert�prepath�pop�getChildWithDefault)r�pathr,r"r	r	r
�getChildbs

zNameVirtualHost.getChild)
rrrrr&rrrrrr/r0r9r	r	r	r
r,s
rc@seZdZdd�ZdS)�
_HostResourcecCs�d|vr|�dd�\}}t|�}n|d}}|�||�d|��dt|�t|jd�}dd�|j�|_|j	|d�|_	|jdd�=|j
�|�S)Nr#r$�P������/)r)�int�setHost�isSecure�lenr5�joinr3r8�uri�site�getResourceFor)rr8r,r.�port�	prefixLenr	r	r
r9ms

&z_HostResource.getChildN)rrrr9r	r	r	r
r:lsr:c@seZdZdZdd�ZdS)�VHostMonsterResourcea.
    Use this to be able to record the hostname and method (http vs. https)
    in the URL without disturbing your web site. If you put this resource
    in a URL http://foo.com/bar then requests to
    http://foo.com/bar/http/baz.com/something will be equivalent to
    http://foo.com/something, except that the hostname the request will
    appear to be accessing will be "baz.com". So if "baz.com" is redirecting
    all requests for to foo.com, while foo.com is inaccessible from the outside,
    then redirect and url generation will work correctly
    cCs0|dkrdd�|_t�S|dkrdd�|_t�S)NshttpcS�dS)Nrr	r	r	r	r
�<lambda>��z/VHostMonsterResource.getChild.<locals>.<lambda>shttpscSrK)Nr$r	r	r	r	r
rL�rM)rBr:)rr8r,r	r	r
r9�s
�
zVHostMonsterResource.getChildN)rrrrr9r	r	r	r
rJ{srJN)r�htmlrr*�ImportError�cgi�twisted.pythonr�twisted.webr�
Homogenousrrrr:rJr	r	r	r
�<module>s�@

Spamworldpro Mini