403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.174
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python315/Lib/http/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python315/Lib/http/__pycache__/server.cpython-315.opt-1.pyc
R
>lqj��c	�&�Qs,QNs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]PH,s]PH0s]PH4s
]PH8s]PH<s]PH@s]PHDs]PHHs]QHGs]PHUsQsQ	sQ
Q\O02sQQ\O4\2sQQ\2sQ
Q\O4\2sQQ\O<2sQQ\2s Pr!Qs"Qs#Qs$\\QQPPPP\ OJ1	Qks&\ \QQP\ OJPPP1	Qks'QQks(Qs)\*Q6Xc
\(2P!P!)a�HTTP server classes.

Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST.

It does, however, optionally implement HTTP/1.1 persistent connections.

XXX To do:

- log requests even later (to capture byte count)
- log user-agent header and other interesting goodies
- send error log to separate file
�
HTTPServer�ThreadingHTTPServer�HTTPSServer�ThreadingHTTPSServer�BaseHTTPRequestHandler�SimpleHTTPRequestHandler)�
HTTPStatusa�<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <style type="text/css">
            :root {
                color-scheme: light dark;
            }
        </style>
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: %(code)d</p>
        <p>Message: %(message)s.</p>
        <p>Error code explanation: %(code)s - %(explain)s.</p>
    </body>
</html>
ztext/html;charset=utf-8c�0`�\sQs]ssnP	sP
sQsQsUsP!)rc��[OOU2UOQ*vq[O
U2UmV mP!)z.Override server_bind to store the server name.�N�N)�socketserver�	TCPServer�server_bind�server_address�socket�getfqdn�server_name�server_port)�self�host�ports&  � C:\Python315\\Lib\http\server.pyr�HTTPServer.server_bindxs?�����*�*�4�0��(�(��,�
��!�>�>�$�/�����)rr)	�__name__�
__module__�__qualname__�__firstlineno__�allow_reuse_address�allow_reuse_portr�__static_attributes__�__classdictcell__)�
__classdict__s@rrrss�������� � rc��\sQs]�sP	sQsP!)r��rrrr�daemon_threadsr r$rrrr�����Nrc�Z``�\sQs]�snQQPQPQP-U1QkkksU1QksQsQsUsU9s	!)	r�keyfile�password�alpn_protocolsc�:�]PHoV�mV@mVPmV`mUeQ,LSUm[R	U_!UUU2P![c
[Q2gh9h)�z3SSL module is missing; HTTPS support is unavailablezhttp/1.1)	�ssl�ImportError�RuntimeError�certfiler)r*r+�super�__init__)
rr�RequestHandlerClass�bind_and_activater1r)r*r+r.�	__class__s
&&&&$$$$ �rr3�HTTPSServer.__init__�sq���	?��
�� �
��� �
�+�2�Z�L��	
��	����,�*�	,���	?�� >�?�
?�	?�s�A�	A�
Ac�:�[RU_2UO2oUOUOP	Q5UmP!)zWrap the socket in SSLSocket.)�server_side)r2�server_activate�_create_context�wrap_socketr)r�contextr6s& �rr:�HTTPSServer.server_activate�s7���
���!��&�&�(���)�)�$�+�+�4�)�H��rc��UOOUOOO2oUO	UO
UOUO2UOUO2U!)zCreate a secure SSL context.)
r.�create_default_context�Purpose�CLIENT_AUTH�load_cert_chainr1r)r*�set_alpn_protocolsr+)rr=s& rr;�HTTPSServer._create_context�s]���(�(�1�1�$�(�(�2B�2B�2N�2N�O������
�
�t�|�|�T�]�]�K��"�"�4�#6�#6�7��r)r+r1r)r*rr.)T)
rrrrr3r:r;r r!�
__classcell__�r6r"s@@rrr�s7����,�>B�,��,�/3�,�,�,I��rc��\sQs]�sP	sQsP!)rr$r%r$rrrr�r'rc
�`�\sQs]�snQsQ\OO2]**sQs	\
s\s
QsQsQsQsQsQQ	ksQQ
ksQQksQP
-Q
ksQsQsQsQ QksQs\O;\O>\ ] 2\ ]]�22Tt-tFD	pQUQ
0aJ	to2s!Q\!\"Q2$Qs#Qs$QQks%Qs&,Q!Ns',Q"Ns(Qs)Qs*\+OXOZs.\/O`Oc2Tt-tFDoVOdUOf1aJ	tos4Qs5Us6P!ttohttoh)#ra�
HTTP request handler base class.

The following explanation of HTTP serves to guide you through the
code as well as to expose any misunderstandings I may have about
HTTP (so you don't need to read the code to figure out I'm wrong
:-).

HTTP (HyperText Transfer Protocol) is an extensible protocol on
top of a reliable stream transport (e.g. TCP/IP).  The protocol
recognizes three parts to a request:

1. One line identifying the request type and path
2. An optional set of RFC-822-style headers
3. An optional data part

The headers and data are separated by a blank line.

The first line of the request has the form

<command> <path> <version>

where <command> is a (case-sensitive) keyword such as GET or POST,
<path> is a string containing path information for the request,
and <version> should be the string "HTTP/1.0" or "HTTP/1.1".
<path> is encoded using the URL encoding scheme (using %xx to signify
the ASCII character with hex code xx).

The specification specifies that lines are separated by CRLF but
for compatibility with the widest range of clients recommends
servers also handle LF.  Similarly, whitespace in the request line
is treated sensibly (allowing multiple spaces between components
and allowing trailing whitespace).

Similarly, for output, lines ought to be separated by CRLF pairs
but most clients grok LF characters just fine.

If the first line of the request has the form

<command> <path>

(i.e. <version> is left out) then this is assumed to be an HTTP
0.9 request; this form has no optional headers and data part and
the reply consists of just the data.

The reply form of the HTTP 1.x protocol again has three parts:

1. One line giving the response code
2. An optional set of RFC-822-style headers
3. The data

Again, the headers and data are separated by a blank line.

The response code line has the form

<version> <responsecode> <responsestring>

where <version> is the protocol version ("HTTP/1.0" or "HTTP/1.1"),
<responsecode> is a 3-digit response code indicating success or
failure of the request, and <responsestring> is an optional
human-readable string explaining what the response code means.

This server parses the request and the headers, and then calls a
function specific to the request type (<command>).  Specifically,
a request SPAM will be handled by a method do_SPAM().  If no
such method exists the server sends an error response to the
client.  If it exists, it is called with no arguments:

do_SPAM()

Note that the request name is case sensitive (i.e. SPAM and spam
are different requests).

The various request details are stored in instance variables:

- client_address is the client IP address in the form (host,
port);

- command, path and version are the broken-down request line;

- headers is an instance of email.message.Message (or a derived
class) containing the header information;

- rfile is a file object open for reading positioned at the
start of the optional input data part;

- wfile is a file object open for writing.

IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING!

The first thing to be written must be the response line.  Then
follow 0 or more header lines, then a blank line, and then the
actual data (if any).  The meaning of the header lines depends on
the command executed by the server; in most cases, when data is
returned, there should be at least one header line of the form

Content-type: <type>/<subtype>

where <type> and <subtype> should be registered MIME types,
e.g. "text/html" or "text/plain".

zPython/�BaseHTTP�HTTP/0.9c��	�P
oPUmUO9UmoP	Um[	UO
Q2oUO
Q2oV0mUO2o[U2]6XcP
![U2]6�CciUP*oUOQ2%f[gUOQ]2]*oUOQ2o[U2]6wc[g[9PIcQU2D%fJP	L	P
LQU22%c[Q2g[9PIcQU2D%fJP	L	P
LQU22%c[Q	2g[U]*2[U]*21oV mUQ6�cUO$Q6�cP
UmUQ6�c*UO[ O&QU*2P
!][U2t96:c]6:f3LPUmUO[ O"Q
U*2P
!UQ*vqx[U2]6XcAP	UmUQ6wc1PUmUO[ O"QU*2P
!P	oVxtUmUmUO(OQ2%c(QUO(O+Q2*UmU%c
-UmP	![.O0O3UO4UO6Q5UmUO,O?QP2o
U
OA2Q6Xc	P	UmL-U
OA2Q6XcUO$Q6�cP
UmUO,O?QP2oUOA2Q6Xc;UO$Q6�c*UOQ6�cUOC2%fP
!P	![[1c3PSmSO[ O"Q
S*2P
!h9h[.O0O8c6o	SO[ O:Q[	S	22Po	=	P
!Po	=	h[.O0O<c6o	SO[ O:Q[	S	22Po	=	P
!Po	=	hh9h)aParse a request (internal).

The request should be stored in self.raw_requestline; the results
are in self.command, self.path, self.request_version and
self.headers.

Return True for success, False for failure; on failure, any relevant
error response has already been sent back.

z
iso-8859-1�
zHTTP/�/�.c3�V�SF �DpO2%(w�	J	P!3h�N)�isdigit��.0�	components& r�	<genexpr>�7BaseHTTPRequestHandler.parse_request.<locals>.<genexpr>Ks������9�,�,�.�.�.��s�")znon digit in http versionc3�J�SF �Do[U2]
6�w�	J	P!3h)�
)�lenrSs& rrVrWMs��N���N�y�s�9�~��*�N�s�#z unreasonable length http versionzBad request version (%r)zHTTP/1.1zInvalid HTTP version (%s)zBad request syntax (%r)r
�GETzBad HTTP/0.9 request type (%r)z//)�_classz
Line too longzToo many headers�
Connection�close�
keep-alive�Expectz100-continue)�ra)rr-)"�command�default_request_version�request_version�close_connection�str�raw_requestline�rstrip�requestline�splitrZ�
startswith�
ValueError�any�int�
IndexError�
send_errorr�BAD_REQUEST�protocol_version�HTTP_VERSION_NOT_SUPPORTED�path�lstrip�headers�http�client�
parse_headers�rfile�MessageClass�LineTooLong�REQUEST_HEADER_FIELDS_TOO_LARGE�
HTTPException�get�lower�handle_expect_100)r�is_http_0_9�versionri�words�base_version_number�version_numberrbrt�err�conntype�expects&           r�
parse_request�$BaseHTTPRequestHandler.parse_request&s�������)-�)E�)E�E���w� $����$�.�.��=��!�(�(��0��&���!�!�#���u�:��?���u�:��?��B�i�G�
��)�)�'�2�2�$�$�&-�m�m�C��&;�A�&>�#�!4�!:�!:�3�!?���~�&�!�+�$�$��3�O��O�3�3�3�O��O�O�O�$�%@�A�A��3�K�N�K�3�3�3�K�N�K�K�K�$�%G�H�H�!$�^�A�%6�!7��^�A�=N�9O�!O��$+� ���'�D�,A�,A�Z�,O�(-��%���'�����9�9�/�2E�E�G���C��J�#�!�#�#%�D� ��O�O��&�&�)�K�7�
9���b�	�
���u�:��?�$(�D�!��%��')��$�����*�*�4�w�>�@���K�")����d�i��9�9����%�%��d�i�i�.�.�s�3�3�D�I���D�L��	��;�;�4�4�T�Z�Z�<@�<M�<M�5�O�D�L� �<�<�#�#�L�"�5���>�>��w�&�$(�D�!��n�n��,�.��#�#�z�1�$)�D�!����!�!�(�B�/���L�L�N�n�,��%�%��3��$�$�
�2��)�)�+�+����[�
�+�
�')��$�����*�*�.��8�:��

��d�{�{�&�&�	��O�O��:�:���C��
����{�{�(�(�	��O�O��:�:�"��C��
�
��
	�sx�P�&?P�&P�7P�P�%P�;P�P�)/P�::Q
�Q
�/Q
�	Q
�
S3�+S3�,*R� S3�=S3�>*S.�.S3c�f�UO[O2UO2P	!)a�Decide what to do with an "Expect: 100-continue" header.

If the client is expecting a 100 Continue response, we must
respond with either a 100 Continue or a final response before
waiting for the request body. The default is to always respond
with a 100 Continue. You can behave differently (for example,
reject unauthorized requests) by overriding this method.

This method should either return True (possibly after sending
a 100 Continue response) or send an error response and return
False.

)�send_response_onlyr�CONTINUE�end_headers�rs&rr��(BaseHTTPRequestHandler.handle_expect_100�s'��	
���
� 3� 3�4�����rc��UOOQ2Um[UO2Q6�c7PUmPUmPUmUO[O2P!UO%f
P	Um
P!UO2%fP!QUO*o[V2%f4UO[OQUO*2P![V2oU2UOO!2P!["c%oSO%QS2P	Sm
Po=P!Po=hh9h)z�Handle a single HTTP request.

You normally don't need to override this method; see the class
__doc__ string for information on how to handle specific HTTP
commands such as GET and POST.

ii�do_zUnsupported method (%r)zRequest timed out: %r)rz�readlinergrZrirdrbrpr�REQUEST_URI_TOO_LONGrer��hasattr�NOT_IMPLEMENTED�getattr�wfile�flush�TimeoutError�	log_error)r�mname�method�es&   r�handle_one_request�)BaseHTTPRequestHandler.handle_one_request�s��	�#'�:�:�#6�#6�u�#=�D� ��4�'�'�(�5�0�#%�� �')��$�!������
� ?� ?�@���'�'�'�(,��%���%�%�'�'���D�L�L�(�E��4�'�'�����.�.�-����<�>���T�)�F��H��J�J������	��N�N�2�A�6�$(�D�!���		�sF�9D+�4D+�3D+�D+�D+�&#D+�
1D+�=,D+�+	E�5E�6E�Ec�~�P	UmUO2UO%fUO2J$P!)z&Handle multiple requests if necessary.)rer�r�s&r�handle�BaseHTTPRequestHandler.handle�s3�� $������!��'�'�'��#�#�%�(rc��UOU*vqEUeSoUeSoUOQV2UOV2UO	QQ2PoU]�6�c�U[
O[
O[
O17c�UOQUQ[OUP
Q5Q[OUP
Q5-*oUOQ	Q
2oUO	QUO2UO	Q[[U222UO!2UO"Q
6wc(U%cUO$O'U2P!P!P![cQQqTCKph9h)aSend and log an error reply.

Arguments are
* code:    an HTTP error code
           3 digits
* message: a simple optional 1 line reason phrase.
           *( HTAB / SP / VCHAR / %x80-FF )
           defaults to short entry matching the response code
* explain: a detailed message defaults to the long entry
           matching the response code.

This sends an error response (so it must be called before any
output has been generated), logs the error, and finally sends
a piece of HTML explaining the error to the user.

z???zcode %d, message %sr]r^�code�message��quote�explainzUTF-8�replacezContent-Type�Content-Length�HEAD)�	responses�KeyErrorr��
send_response�send_headerr�
NO_CONTENT�
RESET_CONTENT�NOT_MODIFIED�error_message_format�html�escape�encode�error_content_typerfrZr�rbr��write)rr�r�r��shortmsg�longmsg�body�contents&&&&    rrp�!BaseHTTPRequestHandler.send_error�sY��$	-� $���t� 4��H��?��G��?��G����,�d�<����4�)�����w�/�
���C�K���.�.�#�1�1�#�0�0�2�
2�
�0�0����4�;�;�w�e�<��4�;�;�w�e�<�4��G�
�>�>�'�9�5�D����^�T�-D�-D�E����-�s�3�t�9�~�>������<�<�6�!�d��J�J���T�"�'+�!��=�	-� %�u�g�	-�s�E7�7	F	�F	�F	c���UOU2UOV2UOQUO22UOQUO	22P!)z�Add the response header to the headers buffer and log the
response code.

Also send two standard headers with the server software
version and the current date.

�Server�Date)�log_requestr�r��version_string�date_time_string�rr�r�s&&&rr��$BaseHTTPRequestHandler.send_responsesR��	
���������.�����4�#6�#6�#8�9������!6�!6�!8�9rc�>�UOQ6wc�Ue.VO7cUOU*]*oLPo[UQ2%f,UmUOO	QUO
V1*O
QQ22P!P!)zSend the response header only.rK�_headers_bufferz
%s %d %s
�latin-1�strict)rdr�r�r��appendrrr�r�s&&&rr��)BaseHTTPRequestHandler.send_response_only s������:�-����>�>�)�"�n�n�T�2�1�5�G� �G��4�!2�3�3�')��$�� � �'�'���*�*�D�:�*;�<B�F�!�8�=-�
.�.r�	_is_extrac���UOQ6wc�[UQ2%f,UmUOOU8QU8Q0O	QQ22[UQ2%f,UmU%fUO
OV12UO
2Q6Xc?UO
2Q	6Xc
P	UmP!UO
2Q
6Xc
P
UmP!P!P!)z)Send a MIME header to the headers buffer.rKr�z: rMr�r��_default_response_headers�
connectionr^r_)rdr�r�r�r�r�r�re)r�keyword�valuer�s&&&$rr��"BaseHTTPRequestHandler.send_header.s������:�-��4�!2�3�3�')��$�� � �'�'�!(�%�0�8�8��H�M�
O��4�!<�=�=�13��.���.�.�5�5�w�6F�G��=�=�?�l�*��{�{�}��'�(,��%�����,�.�(-��%�/�+rc��UOQ6wc.UOOQ2UO2P!P!)z,Send the blank line ending the MIME headers.rKs
)rdr�r��
flush_headersr�s&rr��"BaseHTTPRequestHandler.end_headers@s5�����:�-�� � �'�'��0���� �.rc���[UQ2%c<UOOQOUO22,Um[UQ2%c
,UmP!P!)r�rr�)r�r�r��joinr�r�r�s&rr��$BaseHTTPRequestHandler.flush_headersFsT���4�*�+�+��J�J���S�X�X�d�&:�&:�;�<�#%�D� ��4�4�5�5�-/�D�*�6rc	�.�[U2oUQ6�cUOoLIUQ6�cUOoL5UQ6�cUOoL!U]�6�cUOoL
UO
oUOOUO2oUOP]2o[U2]6Xc(Uvq�o
UQUOU	UOQU
0oQUQUUQUOUUO0	![[1cPoK�h9h)����,� �"z" )rn�status_server_error�status_client_error�status_redirect�	status_ok�status_informational�	TypeErrorrlri�	translate�_control_char_tablerjrZrt�reset�size)rr�r��t�code_int�
code_color�request_line�partsr�rtr�s&&&&       r�_colorize_request�(BaseHTTPRequestHandler._colorize_requestMs��	4��4�y�H��3���2�2�
��S���2�2�
��S���.�.�
��S���[�[�
��3�3�
��'�'�1�1�$�2J�2J�K���"�"�4��+���u�:��?�$)�!�F�'�$�X�Q�q�v�v�h�t�f�Q�W�W�I�Q�w�i�H�L��<�.��:�,�t�f�A�a�f�f�X�d�V�A�G�G�9�M�M��)�:�&�	��J�	�s�C>�>D�D�Dc��[U[2%c
UOoV1UmUO	QUO
[
U2[
U22P!)z>Log an accepted request.

This is called by send_response().

z
"%s" %s %s)�
isinstancerr��_log_request_info�log_messagerirf)rr�r�s&&&rr��"BaseHTTPRequestHandler.log_requestfsJ���d�J�'�'��:�:�D�"&���������)�)�3�t�9�c�$�i�	Arc�@�P	UmUOU,UN3P!)z�Log an error.

This is called when a request cannot be fulfilled.  By
default it passes the message on to log_message().

Arguments are the same as for log_message().

XXX This should go to the separate error log.

)�
_log_is_errorr�)r�format�argss&&*rr�� BaseHTTPRequestHandler.log_errorrs��"�������'�$�'rz\x�02xz\\�\c�,�V*OUO2o[O[O
Q5Oo[UQP2oUdPUmUO,UNUM3oL6[UQP
2%c$P
Um
UOUUO0o[O
OUOUO2QUO!2QUOQUQ0	2P!)a�Log an arbitrary message.

This is used by all other logging functions.  Override
it if you have specific logging wishes.

The first argument, FORMAT, is a format string for the
message to be logged.  If the format string contains
any % escapes requiring parameters, they should be
specified as subsequent arguments (it's just like
printf!).

The client ip and current date/time are prefixed to
every message.

Unicode control characters are replaced with escaped hex
before writing the output to stderr.

)�tty_filer�r�z - - [�]r��
)r�r��	_colorize�	get_theme�sys�stderr�http_serverr�r�r�r��errorr�r��	timestamp�address_string�log_date_time_string)rr�r�r�r��infos&&*   rr��"BaseHTTPRequestHandler.log_message�s���&�=�+�+�D�,D�,D�E��������4�@�@���t�0�$�7����%)�D�"��,�,�6�d�6�A�6�G�
�T�?�E�
2�
2�!&�D�����	�'��1�7�7�)�4�G��
�
����{�{�m�D�/�/�1�2�3��)�)�+�,�A�a�g�g�Y�a��i�r�
�	
rc�L�UOQ*UO*!)z*Return the server software version string.r�)�server_version�sys_versionr�s&rr��%BaseHTTPRequestHandler.version_string�s���"�"�S�(�4�+;�+;�;�;rc�x�Ue[O2o[OOUP	Q5!)z@Return the current date and time formatted for a message header.)�usegmt)�time�email�utils�
formatdate)rrs&&rr��'BaseHTTPRequestHandler.date_time_string�s-�����	�	��I��{�{�%�%�i��%�=�=rc	��[O2o[OU2v	q#qEqgq�o
QV@OU*V%Vg1*oU!)z.Return the current time formatted for logging.z%02d/%3s/%04d %02d:%02d:%02d)r�	localtime�	monthname)r�now�year�month�day�hh�mm�ss�x�y�z�ss&           rr
�+BaseHTTPRequestHandler.log_date_time_string�sJ���i�i�k��04���s�0C�-��S�b�a�A�*��^�^�E�*�D�b�.>�
>���rc�*�UO]*!)zReturn the client address.)�client_addressr�s&rr	�%BaseHTTPRequestHandler.address_string�s���"�"�1�%�%r�HTTP/1.0)r�r�r�r�rerbrvrtrgrdri)NNrQ)�-r+)�Mon�Tue�Wed�Thu�Fri�Sat�Sun)
N�Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Dec)7rrrr�__doc__rr�rjrr�DEFAULT_ERROR_MESSAGEr��DEFAULT_ERROR_CONTENT_TYPEr�rcr�r�r�r�rpr�r�r�r�r�r�r�r�rf�	maketrans�	itertools�chain�ranger��ordr�r�r�r
�weekdaynamerr	rrrwrx�HTTPMessager{r�__members__�values�phrase�descriptionr�r r!)�c�vr"s00@rrr�sv����d�N�c�k�k�/�/�1�!�4�4�K�
 �N�0��3��)��w�r�$#�J&�3#�j:�.�.�u�.�$!�0�N�2
A�(��-�-�'0���u�T�{�E�$�t�DT�'U�V�'U�!�2�a��W�
�
�'U�V�X��%*���D�	�"�"
�H<�>��D�K�;�I�&�"���;�;�*�*�L�
�'�'�.�.�0��0�A�	
�H�H�a�m�m�$�$�0��I��]
W��\s�D7�#D<c�``�\sQsQsnQsQsQsQsQQQQQQ	Q
Q-9ss	QPQ
P-U1Qkks
QsQsQs
QsQsQsQsQsQsUsU9s!)r��a?Simple HTTP request handler with GET and HEAD commands.

This serves files from the current directory and any of its
subdirectories.  The MIME type for files is determined by
calling the .guess_type() method.

The GET and HEAD requests are identical except that the HEAD
request omits the actual contents of the file.

�
SimpleHTTPzapplication/octet-streamz.gzzapplication/gzipz.Zz.bz2zapplication/x-bzip2z.xzzapplication/x-xz�	directory�extra_response_headersc�:�Ue[O2o[OU2UmV m[
RU_U-U@P!rQ)�os�getcwd�fspathrRrSr2r3)rrRrSr��kwargsr6s&$$*,�rr3�!SimpleHTTPRequestHandler.__init__�s<������	�	��I����9�-���&<�#�
���$�)�&�)rc��UO2oU%c/UOVO2UO2P!P!SO2h9h)zServe a GET request.)�	send_head�copyfiler�r^�r�fs& r�do_GET�SimpleHTTPRequestHandler.do_GET�sA���N�N����
��
�
�a���,����	�	
�����	�s�A
�
Ac�\�UO2oU%cUO2P!P!)zServe a HEAD request.)r[r^r]s& r�do_HEAD� SimpleHTTPRequestHandler.do_HEAD�s���N�N����
�G�G�I�
rc��UOdqUOTTt.tFDvqUO2jJ	oooUOFD/vqEUO2U7fJUOVEP	Q5J1	P!P!ttooh)z7Send the headers stored in self.extra_response_headers.)r�)rSr�r�r�)r�h�_�default_headers�headerr�s&     r�_send_extra_response_headers�5SimpleHTTPRequestHandler._send_extra_response_headersso���&�&�2�59�5S�5S�T�5S�T�Q�q�w�w�y�5S�O�T�!%�!<�!<�
���<�<�>��8��$�$�V�d�$�C�	"=�3��Ts�Bc���UOUO2oPo[OOU2%Cc^[O
O
UO2oUOOQ
2%f�UO[O2U]*U]*U]*Q*U]*U]*1o[O
OU2oUOQU2UOQQ2UO2P!UOFDLo[OOV2o[OO!U2%fJISoL	UO#U2!UO%U2oUOQ2%c#UO'[O(Q2P![+UQ2o[O.UO122oQUO27Cc?QUO27Cc-[4O6O9UO2Q*2o	U	O:e+U	O=[>O@OBQ	5o	U	O:[>O@OBIc�[>O>OEUOF[>O@OB2o
U
O=]Q
5o
V�6:cBUO[OH2UO2UOK2P!UO[OT2UOQU2UOQ[WU]*22UOQUOYUOF22UO[2UO2U![,c%SO'[O(Q2P!h9h[L[N[P[R1cK�h9hSOK2g9h)aKCommon code for GET and HEAD commands.

This sends the response code and MIME headers.

Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or
None, in which case the caller has nothing further to do.

rN�Locationr��0zFile not found�rbzIf-Modified-Sincez
If-None-Match)�tzinfo)�microsecond�Content-typez
Last-Modified)rNz%2fz%2F).�translate_pathrtrU�isdir�urllib�parse�urlsplit�endswithr�r�MOVED_PERMANENTLY�
urlunsplitr�r��index_pagesr��isfile�list_directory�
guess_typerp�	NOT_FOUND�open�OSError�fstat�filenorvrr�parsedate_to_datetimeror��datetime�timezone�utc�
fromtimestamp�st_mtimer�r^r�ro�
OverflowErrorrl�OKrfr�ri)rrtr^r��	new_parts�new_url�index�ctype�fs�ims�
last_modifs&          rr[�"SimpleHTTPRequestHandler.send_head
sW���"�"�4�9�9�-����
�7�7�=�=�����L�L�)�)�$�)�)�4�E��:�:�&�&�':�;�;��"�"�:�#?�#?�@�"�1�X�u�Q�x��q��C��"�1�X�u�Q�x�1�	� �,�,�1�1�)�<��� � ��W�5�� � �!1�3�7�� � �"���)�)�������T�1���7�7�>�>�%�(�(� �D��	*��*�*�4�0�0�����%���=�=�����O�O�J�0�0�2B�C��	��T�4� �A�
(	����!�(�(�*�%�B�#�t�|�|�3�'�t�|�|�;�(��+�+�;�;����%8�9�;�C��z�z�)�"�k�k��1B�1B�1F�1F�k�G���z�z�X�%6�%6�%:�%:�:�%-�%6�%6�%D�%D��K�K��):�):�)>�)>�&@�
�&0�%7�%7�A�%7�%F�
�%�,� �.�.�z�/F�/F�G� �,�,�.��G�G�I�#'����z�}�}�-����^�U�3����-�s�2�a�5�z�:����_��%�%�b�k�k�2�
4��-�-�/������H��S�	��O�O�J�0�0�2B�C��	��"�:�}�j�I�����:	�
�G�G�I��so�-P�:5Q!�0Q!�0Q�3
Q!�AQ!�AQ!�-?Q!�.BQ!�	P=�!P=�<P=�Q�Q�Q!�Q�Q!�!Q4c��[OU2oUO
QQ5,oUOoUOQ]2]*oUOQ]2]*o[OOUQQ5o[OUP
Q5o[O 2oQ	U0oUO#Q
2UO#Q2UO#Q2UO#Q
UQ02UO#Q2UO#QUQ02UO#QUQ02UO#Q2SFD�o[OO%V2oS9q�[OO'U2%cUQ*o	UQ*o
[OO)U2%c
UQ*o	UO#Q[OO+U
QQ58Q[OU	P
Q58Q02J�	UO#Q2QO%U2O-UQ2o[.O02oUO3U2UO5]2UO7[O82UO;QQU*2UO;Q[=[?U222UOA2UOC2U![c%SO[O
Q2P!h9h[c$[OOS2oCK�h9h)z�Helper to produce a directory listing (absent index.html).

Return value is either a file object, or None (indicating an
error).  In either case, the headers are sent, making the
interface the same as for send_head().

zNo permission to list directoryc�$�UO2!rQ)r�)�as&r�<lambda>�9SimpleHTTPRequestHandler.list_directory.<locals>.<lambda>us
�����	r)�key�#�?�
surrogatepass��errorsr�zDirectory listing for z<!DOCTYPE HTML>z<html lang="en">z<head>z<meta charset="z">zD<style type="text/css">
:root {
color-scheme: light dark;
}
</style>z<title>z</title>
</head>z<body>
<h1>z</h1>z	<hr>
<ul>rN�@z
<li><a href="z	</a></li>z</ul>
<hr>
</body>
</html>
r�surrogateescaperqztext/html; charset=%sr�)"rU�listdirr�rprr~�sortrtrjrtru�unquote�UnicodeDecodeErrorr�r�r�getfilesystemencodingr�r�rs�islinkr�r��io�BytesIOr��seekr�r�r�rfrZrir�)
rrt�list�r�displaypath�enc�title�name�fullname�displayname�linkname�encodedr^s
&&           rr|�'SimpleHTTPRequestHandler.list_directoryfs���	��:�:�d�#�D�	
�	�	�)�	�*����i�i��!�'�'��Q�/��2��!�'�'��Q�/��2��	<� �,�,�.�.�{�6E�/�G�K��k�k�+�U�;���'�'�)��(��
�6��	���"�#�	���#�$�	�����	���?�3�%�r�*�+�	���[�\�	���7�5�'�!2�3�4�	���<��w�e�,�-�	������D��w�w�|�|�D�/�H�%)�)�K��w�w�}�}�X�&�&�"�S�j���#�:���w�w�~�~�h�'�'�"�S�j��
�H�H��|�|�)�)�(�1@�*�B��{�{�;�e�<�>�
?��	
���2�3��)�)�A�,�%�%�c�+<�=���J�J�L��	�����	���q�	����:�=�=�)�����)@�3�)F�G����)�3�s�7�|�+<�=��)�)�+��������e�	��O�O��$�$�1�
3��		��"�	<� �,�,�.�.�{�;�K�	<�s/�L�-!M
�	M
�%!M
�	M
�
	M;� M;�:M;c��UOQ]2]*oUOQ]2]*o[OOUQQ5oUOQ2o[OU2oUOQ2o[PU2oUOoSFDno[OOU2%f&U[O[O17cJO[OOV2oJp	U%c
UQ*
oU![c$[OOS2oCKh9h)z�Translate a /-separated PATH to the local filename syntax.

Components that mean special things to the local file system
(e.g. drive or directory names) are ignored.  (XXX They should
probably be diagnosed.)

r�r�r�r�rN)rjrtrur�r�rw�	posixpath�normpath�filterrRrUrt�dirname�curdir�pardirr�)rrt�trailing_slashr��words&&   rrr�'SimpleHTTPRequestHandler.translate_path�s���z�z�#�q�!�!�$���z�z�#�q�!�!�$��	.��<�<�'�'��_�'�E�D����s�+���!�!�$�'���
�
�3����t�U�#���~�~���D��w�w���t�$�$�����B�I�I�0F�(F���7�7�<�<��+�D�	�
��C�K�D����"�	.��<�<�'�'��-�D�	.�s�!D.�.	E�8 E�Ec�4�[OV2P!)a�Copy all data between two file objects.

The SOURCE argument is a file object open for reading
(or anything with a read() method) and the DESTINATION
argument is a file object open for writing (or
anything with a write() method).

The only reason for overriding this would be to change
the block size or perhaps to replace newlines by CRLF
-- note however that this the default server uses this
to copy binary data as well.

)�shutil�copyfileobj)r�source�
outputfiles&&&rr\�!SimpleHTTPRequestHandler.copyfile�s��	���6�.rc�<�[OU2vq#V0O7cUOU*!UO2oV0O7cUOU*![O
U2vqEU%cU!UO!)a{Guess the type of a file.

Argument is a PATH (a filename).

Return value is a string of the form type/subtype,
usable for a MIME Content-type header.

The default implementation looks the file's extension
up in the table self.extensions_map, using application/octet-stream
as a default; however it would be permissible (if
slow) to look inside the data to make a better guess.

)r��splitext�extensions_mapr��	mimetypes�guess_file_type�default_content_type)rrt�base�ext�guessrfs&&    rr}�#SimpleHTTPRequestHandler.guess_type�s����&�&�t�,�	���%�%�%��&�&�s�+�+��i�i�k���%�%�%��&�&�s�+�+��,�,�T�2�����L��(�(�(r�rRrS)z
index.htmlz	index.htm)rrrrr?rr�rzr��_encodings_map_defaultr3r_rbrir[r|rrr\r}r r!rFrGs@@rrr�s�����	�"�N�5��-�K�
�!��(��%�
�!�	/��N�+�*��*�T�*���D�W�r<�|�</� )�)rc��[%c[!]PHoUOQ2]*r[![cPt!h9h[c/][QSO
222*r[!h9h)z$Internal routine to get nobody's uid�nobodyc3�>�SF �Dp]*w�	J	P!3h)rr$)rTr"s& rrV�nobody_uid.<locals>.<genexpr>�s��~���~�!�1���~�s�)r��pwdr/�getpwnamr��max�getpwall)r�s r�
nobody_uidr��s{���v��
���7����h�'��*���M��
���	����7��S�6�s�|�|�~�6�6�6���M�7�s,�8�A�	A�A�A�	B�'B�Bc�N�[OU[O2!)zTest for executable file.)rU�access�X_OK)rts&r�
executabler��s��
�9�9�T�2�7�7�#�#rc��[OUQ[OQ[O-o[	[U22vq#qEoV&1!)�type�flags)r�getaddrinfo�SOCK_STREAM�
AI_PASSIVE�next�iter)�address�infos�familyr��proto�	canonname�sockaddrs*      r�_get_best_familyr�sS�����	�
�
�
�
�
����
�E�
04�D��K�/@�,�F�%�H���rr*�@c	�x�[VC2vUmo	V mV�mU%cUV�UVgQ5!UV�2!))r1r)r*)r��address_familyrrr�)
�HandlerClass�ServerClass�protocolr�bind�tls_cert�tls_key�tls_passwordr��addrs
&&&&&&&&& r�_make_serverr�
sH��
(8��'C�$�K���$,�!�(<�%���4��#*�C�	C��4�.�.rc	�v�[VV#UVgUUQ5	9^tt^2o	U	OO2Q*vq�QU
7cQU
Q0LS
oU%cQLQo[O2O
oUO
2QUQUQ	0o
[UOQ
UQU
QUUOQ
UOU
UOQ0
2U	O2PPP2P![c%[Q2[O]2K8h9h)%fhP!9h)zdTest the HTTP request handler class.

This runs an HTTP server on port 8000 (or the port argument).
)	r�r�r�rr�r�r�r�r�r
�:�[r�HTTPS�HTTPz://rNzServing z on z port z (z) ...z&
Keyboard interrupt received, exiting.)r�r�getsocknamerrrr��print�servingr��url�
serve_forever�KeyboardInterruptr�exit)r�r�r�rr��content_typer�r�r��httpdr�url_hostr�rs&&&&&&&&&     r�testrs.��
�!��4���)�	
�
�

��\�\�-�-�/��3�
��"%��+�Q�t�f�A�;�4��&�7�F�����!�-�-�����!�"�#�h�Z�q���a�8��
��y�y�k��(��4��v�V�D�6�!�'�'��K����w�s�e�A�G�G�9�E�
+�	
�	����!�!
�
��"!�	��;�<��H�H�Q�K�	��#
�
�
�sB�*D'�D'�BD'�C5�5	D$�?"D$�!D'�#D$�$D'�'D8	�0D8	c�8``
�]PHo]PHn
UO2oUOQQQQQ5UOQQ[O
2QQ	5UOQ
QQQ
QQ5UOQ[OQQ	5UOQQQQ5UOQQQQ5UOQQQQ5UOQQ[QQQ5UOQQ]Q Q0Q!Q"5UOR2nRO%f$RO%cUOQ#2PoRO%clRO%fUOQ$2[ROQ%Q&Q'59^tt^2oUO2O!2oPPP2UU
1Q)kQ*2oQ+Q,U[$2oQ-Q.U[&2oRO%cSLSo	[)[U	RO*RO,RO.RO0ROROUQ/5	P!)%fhK�9h["coSOQ(S02Po=K�Po=hh9h)1r-z-bz--bind�ADDRESSz.bind to this address (default: all interfaces))�metavar�helpz-dz--directoryz1serve this directory (default: current directory))�defaultrz-pz
--protocol�VERSIONr*z3conform to this HTTP version (default: %(default)s))r
rrz--content-typezBdefault content type for unknown extensions (default: %(default)s)z
--tls-cert�PATHz&path to the TLS certificate chain filez	--tls-keyzpath to the TLS key filez--tls-password-filez)path to the password file for the TLS keyrr�r�z(bind to this port (default: %(default)s))rr��nargsrz-Hz--headerr�z>Add a custom response header (can be specified multiple times))r�actionr
rz'--tls-key requires --tls-cert to be setz1--tls-password-file requires --tls-cert to be setr�zutf-8)�encodingz"Failed to read TLS password file: c�D:``�\sQsQsnUU1QksU1QksQsUsU9s!)�#_main.<locals>.DualStackServerMixinimc�:�RO[29^tt^2UOO[O[O
]2PPP2[RU_2!)%fhK9h)r-)�suppress�	Exceptionr�
setsockopt�IPPROTO_IPV6�IPV6_V6ONLYr2r)rr6�
contextlibs&��rr�/_main.<locals>.DualStackServerMixin.server_bindosX����$�$�Y�/�/����&�&��'�'��);�);�Q�@�0��7�&�(�(�0�/�s�:A0�0B	�9B	c�\:�UOVUROROQ5P!)r�)r4rRrh)r�requestr(r�s&&&�r�finish_request�2_main.<locals>.DualStackServerMixin.finish_requestvs)����$�$�W�d�/3�~�~�<@�K�K�
%�
Irr$)	rrrrrrr r!rF)r6r"r�rs@@��r�DualStackServerMixinrms����	)�	I�	Irr c��\sQsQsQsP!)�"_main.<locals>.HTTPDualStackServeri{r$�rrrrr r$rr�HTTPDualStackServerr"{���rr$c��\sQsQsQsP!)�#_main.<locals>.HTTPSDualStackServeri}r$r#r$rr�HTTPSDualStackServerr'}r%rr()	r�r�rr�r�rr�r�r�)�HEADER�VALUE)�argparser�ArgumentParser�add_argumentrUrVrr�rn�
parse_argsr�r�r�tls_password_filer�read�stripr�rrrrr�r�r)r�r+�parser�tls_key_passwordr^r�r r$r(r�rsf         @r�_mainr4<sz�����
�
$�
$�
&�F�
����h�	�9��:�����m�R�Y�Y�[�<��=�����l�I� *�6��7����(� 8� M� M�6��7�����f�E��G�
����V�7��9�
���-�v�H��J�
�����3�c�6��7�����j��(� 3�A��B����T�"�D��=�=�=�T�\�\�\����>�?��������}�}�}��L�L�L�M�	C��d�,�,�c�G�D�D��#$�6�6�8�>�>�#3� �E�I�I�
�2�4G�
�
�3�5I�
�+/�-�-�-�&�=P�K��-��
�Y�Y�
�Y�Y�����&�&�������%�
�7E�D���	C��L�L�=�a�S�A�B�B��	C�sB�< I0�I�;I0�I-	�&I-	�(I0�-I0�0	J�:J�;J�Jc�d�UQ6Xc]QHGoUQQQ5Q![Q[8QU802g)�__version__)�_deprecated)�removez0.6zmodule z has no attribute )��)�warningsr7�AttributeErrorr)r�r7s& r�__getattr__r=�s3���}��(��M�'�2��
�7�8�,�.@���I�
J�Jr�__main__)rrrrrrrQ)+r?�__all__r��email.utilsrr��http.clientrwr�rCr�rUr�r�rrrr�urllib.parsertrrr@rAr
r�ThreadingMixInrrr�StreamRequestHandlerrrr�r�r�r�r�r�rr4r=rr$rr�<module>rEsB���~������	���	��
�
��
�������*7��
 ��'�'�
 ��,�5�5�z��"�*�"�J�<�6�6���f�\�>�>�f�RS)�5�S)�l
��
� $�
�5�0�$�4�d���4�&>�&S�&S�	
/� /�(��4�d�.�C�C���4�	�>P�fK��z��	�G�r

Youez - 2016 - github.com/yon3zu
LinuXploit