a ÕDOgg¼ ã @ sî d Z dZg d¢ZddlZddlZddlZddlZddlZ ddl Z ddlZddlZddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddl mZ dZdZG dd „ d ejƒZG d d„ dejeƒZG dd „ d ejƒZG dd„ deƒZ dd„ Z!da"dd„ Z#dd„ Z$G dd„ de ƒZ%dd„ Z&eedddfdd„Z'e(dkrêddl)Z)ddl*Z*e) +¡ Z,e,j-dd d!d" e,j-d#d$d%d&d' e,j-d(d)e .¡ d*d+ e,j-d,d-de/d.d/d0 e, 0¡ Z1e1j2rÂe%Z3ne Z3G d1d2„ d2eƒZ4e'e3e4e1j5e1j6d3 dS )4a@ HTTP server classes. Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST, and CGIHTTPRequestHandler for CGI scripts. It does, however, optionally implement HTTP/1.1 persistent connections, as of version 0.3. Notes on CGIHTTPRequestHandler ------------------------------ This class implements GET and POST requests to cgi-bin scripts. If the os.fork() function is not present (e.g. on Windows), subprocess.Popen() is used as a fallback, with slightly altered semantics. In all cases, the implementation is intentionally naive -- all requests are executed synchronously. SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL -- it may execute arbitrary Python code or external programs. Note that status code 200 is sent prior to execution of a CGI script, so scripts cannot send other status codes such as 302 (redirect). 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 z0.6)Ú HTTPServerÚThreadingHTTPServerÚBaseHTTPRequestHandlerÚSimpleHTTPRequestHandlerÚCGIHTTPRequestHandleré N)Ú HTTPStatusa¹
Error code: %(code)d
Message: %(message)s.
Error code explanation: %(code)s - %(explain)s.
ztext/html;charset=utf-8c @ s e Zd ZdZdd„ ZdS )r é c C s4 t j | ¡ | jdd… \}}t |¡| _|| _dS )z.Override server_bind to store the server name.Né )ÚsocketserverÚ TCPServerÚserver_bindZserver_addressÚsocketZgetfqdnÚserver_nameÚserver_port)ÚselfÚhostÚport© r ú0/opt/alt/python39/lib64/python3.9/http/server.pyr ‡ s zHTTPServer.server_bindN)Ú__name__Ú __module__Ú__qualname__Zallow_reuse_addressr r r r r r ƒ s r c @ s e Zd ZdZdS )r TN)r r r Zdaemon_threadsr r r r r s r c @ s* e Zd ZdZdej ¡ d Zde Z e ZeZ dZdd„ Zdd „ Zd d„ Zdd „ Zd5dd„Zd6dd„Zd7dd„Zdd„ Zdd„ Zdd„ Zd8dd„Zdd„ Ze d d!„ e ed"ƒed#d$ƒ¡D ƒ¡Z d%e e!d&ƒ<