R
    ¢¤Òj\¬  ã            	       ó&  €   Q s , QNs] PHs] PHs] PHs] PHs] PH s] PH$s	] PH(s
] PH,s] PH0s] PH4s] PH8s] PH<s] PH@s] PHDs] PHHs] QHGs ] PHUsQsQ	s  Q
 Q\O0                  2      s  Q Q\O4                  \2      s  Q Q\2      s  Q Q\O4                  \2      s  Q Q\O<                  2      s  Q Q\2      s Pr!Q s"Q s#Q s$\\QQPPPP\ OJ                  1	Q ks&\ \QQP\ OJ                  PPP1	Q ks'QQ ks(Q s)\*Q6X  c
   \( 2        P! 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>
ztext/html;charset=utf-8c                   ó0   ` €   \ sQ s]ss n P	sP
sQ sQsU sP! )r   c                ó²   €   [         O                  O                  U 2       U O                  Q*          v  q[        O
                   U2      U m        V m        P! )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   &  Ú(/usr/local/lib/python3.15/http/server.pyr   ÚHTTPServer.server_bindx   s?   � ä×Ñ×*Ñ*¨4Ô0Ø×(Ñ(¨Õ,‰
ˆÜ!Ÿ>š>¨$Ó/ˆÔØÖó    )r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Úallow_reuse_addressÚallow_reuse_portr   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   s   s   ø‡ � àÐØÐ÷ ð  r   c                   ó   €   \ sQ s]€sP	sQsP! )r   © ©r   r   r   r   Údaemon_threadsr!   r%   r   r   r   r   €   ó   ‡ Ø„Nr   c                   óZ   ` `€   \ sQ s]„s nQQPQPQP-U 1Q kkksU 1Q ksQ sQsUsU 9s	! )	r   ÚkeyfileÚpasswordÚalpn_protocolsc               ó¶   :€    ] PHoV€m         V@m        VPm        V`m        Ue   Q,LSU m        [        R	U _!  UUU2       P!  [         c    [        Q2      gh 9 h)é    z3SSL module is missing; HTTPS support is unavailablezhttp/1.1)	ÚsslÚImportErrorÚRuntimeErrorÚcertfiler*   r+   r,   ÚsuperÚ__init__)
r   r   ÚRequestHandlerClassÚbind_and_activater2   r*   r+   r,   r/   Ú	__class__s
   &&&&$$$$ €r   r4   ÚHTTPSServer.__init__…   sq   ø� ð	?Ûð
 ŒØ ŒØŒØ Œð +Ò2ˆZ‰L¸ð 	Ôô 	‰Ñ˜Ø,Ø*ö	,øô ô 	?Üð  >ó ?ð ?ð	?ús   „A Á	AÁAc                óŠ   :€   [         RU _  2        U O                  2       oUO                  U O                  P	Q5      U m        P! )zWrap the socket in SSLSocket.)Úserver_side)r3   Úserver_activateÚ_create_contextÚwrap_socketr   )r   Úcontextr7   s   & €r   r;   ÚHTTPSServer.server_activate›   s7   ø� ä‰ÑÔ!Ø×&Ñ&Ó(ˆØ×)Ñ)¨$¯+©+À4Ð)ÓHˆŽr   c                ó  €   U O                   O                  U O                   O                  O                  2      oUO	                  U O
                  U O                  U O                  2       UO                  U O                  2       U! )zCreate a secure SSL context.)
r/   Úcreate_default_contextÚPurposeÚCLIENT_AUTHÚload_cert_chainr2   r*   r+   Úset_alpn_protocolsr,   )r   r>   s   & r   r<   ÚHTTPSServer._create_context¡   s]   � à—(‘(×1Ñ1°$·(±(×2BÑ2B×2NÑ2NÓOˆØ×Ñ §¡¨t¯|©|¸T¿]¹]ÔKØ×"Ñ" 4×#6Ñ#6Ô7Øˆr   )r,   r2   r*   r+   r   r/   )T)
r   r   r   r   r4   r;   r<   r!   r"   Ú__classcell__©r7   r#   s   @@r   r   r   „   s7   ù‡ � ñ,Ø>Bð,àð,à/3÷,ð ,õ,I÷ò r   c                   ó   €   \ sQ s]©sP	sQsP! )r   r%   r&   r%   r   r   r   r   ©   r(   r   c            
       ó‚  `€   \ sQ s]­s nQsQ\O                  O                  2       ] *          *           sQs	\
s\sQsQ sQ sQ sQ sQQ	 ksQQ
 ksQQ ksQP
-Q ksQ sQ sQ sQ Q ksQ s\O;                  \O>                   \  ] 2      \  ]] 2      2      T t- tF   D	  p QU Q 0aJ  	  to 2      s!Q\!\" Q2      $   Q s#Q s$QQ ks%Q s&, Q!Ns', Q"Ns(Q s)Qs*\+OX                  OZ                  s.\/O`                  Oc                  2       Tt- tF   D  oVOd                  UOf                  1aJ  	  tos4Qs5Us6P! t to h t toh )#r   a¯  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".

zPython/ÚBaseHTTPúHTTP/0.9c                óì	  €   P
oPU m         U O                  9U m        oP	U m        [	        U O
                  Q2      oUO                  Q2      oV0m        UO                  2       o[        U2      ] 6X  c   P
! [        U2      ]6¼  Cci   UP*          o UO                  Q2      %       f   [        gUO                  Q]2      ]*          oUO                  Q2      o[        U2      ]6w  c   [        g[        9PI c    Q U2        D  %       f   J   P	L	  P
L Q U2       2      %       c   [        Q2      g[        9PI c    Q U2        D  %       f   J   P	L	  P
L Q U2       2      %       c   [        Q	2      g[        U] *          2      [        U]*          2      1oV m        UQ6¼  c   U O$                  Q6¼  c   P
U m        UQ6¼  c*   U O                  [         O&                  QU*          2       P
! ][        U2      t96:  c   ]6:  f3   L PU m        U O                  [         O"                  QU*          2       P
! UQ*          v  qx[        U2      ]6X  cA   P	U m        UQ6w  c1   PU m        U O                  [         O"                  QU*          2       P
! P	oVxtU m         U m        U O(                  O                  Q2      %       c(   QU O(                  O+                  Q2      *           U m        U%       c
   - U m        P	!  [.        O0                  O3                  U O4                  U O6                  Q5      U m        U O,                  O?                  QP2      o
U
OA                  2       Q6X  c	   P	U m        L-U
OA                  2       Q6X  c   U O$                  Q6¼  c   P
U m        U O,                  O?                  QP2      oUOA                  2       Q6X  c;   U O$                  Q6¼  c*   U O                  Q6¼  c   U OC                  2       %       f   P
! P	!  [        [        1 c3    PS m        S O                  [         O"                  Q
S*          2        P
! h 9 h [.        O0                  O8                   c6   o	S O                  [         O:                  Q[	        S	2      2        Po	=	P
! Po	=	h[.        O0                  O<                   c6   o	S O                  [         O:                  Q[	        S	2      2        Po	=	P
! Po	=	hh 9 h)a  Parse 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ú
zHTTP/Ú/Ú.c              3   óV   €  S F      €   D  pO                  2       %       ( w €	   J  	  P! 3h©N)Úisdigit©Ú.0Ú	components   & r   Ú	<genexpr>Ú7BaseHTTPRequestHandler.parse_request.<locals>.<genexpr>K  s   ùÂé � Á°9×,Ñ,Ó.×.Ò.Ãùs   ‡")znon digit in http versionc              3   óJ   €  S F      €   D  o[        U2      ]
6„  w €	   J  	  P! 3h)é
   )ÚlenrT   s   & r   rW   rX   M  s   ùºNé � ¹N¨y”s˜9“~¨×*»Nùs   ‡#z unreasonable length http versionzBad request version (%r)zHTTP/1.1zInvalid HTTP version (%s)zBad request syntax (%r)r   ÚGETzBad HTTP/0.9 request type (%r)z//)Ú_classzLine too longzToo many headersÚ
ConnectionÚcloseú
keep-aliveÚExpectz100-continue)é   rb   )r   r.   )"ÚcommandÚdefault_request_versionÚrequest_versionÚclose_connectionÚstrÚraw_requestlineÚrstripÚrequestlineÚsplitr[   Ú
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Úversionrj   ÚwordsÚbase_version_numberÚversion_numberrc   ru   Ú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 Ã7P ÄP Ä%P Ä;P ÅP Å)/P Ë::Q ÐQ
Ð/Q
Ñ	Q
ÑS3Ñ+S3Ñ,*RÒ S3Ò=S3Ò>*S.Ó.S3c                óf   €   U O                  [        O                  2       U O                  2        P	! )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©r   s   &r   r‚   Ú(BaseHTTPRequestHandler.handle_expect_100Ÿ  s'   � ð 	×Ñ¤
× 3Ñ 3Ô4Ø×ÑÔÙr   c                óº  €    U O                   O                  Q2      U m        [        U O                  2      Q6”  c7   PU m        PU m        PU m        U O                  [        O                  2       P! U O                  %       f
   P	U m
        P! U O                  2       %       f   P! QU O                  *           o[        V2      %       f4   U O                  [        O                  QU O                  *          2       P! [        V2      oU 2        U O                  O!                  2        P!  ["         c%   oS O%                  QS2       P	S m
         Po=P! Po=hh 9 h)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.

i  i   Údo_zUnsupported method (%r)zRequest timed out: %r)r{   Úreadlinerh   r[   rj   re   rc   rq   r   ÚREQUEST_URI_TOO_LONGrf   r‹   Ú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+ Á3D+ ÂD+ ÂD+ Â&#D+ Ã
1D+ Ã=,D+ Ä+	EÄ5EÄ6EÅEc                ó~   €   P	U m         U O                  2        U O                   %       f   U O                  2        J$  P! )z&Handle multiple requests if necessary.)rf   r¡   r‘   s   &r   ÚhandleÚBaseHTTPRequestHandler.handleÖ  s3   � à $ˆÔà×ÑÔ!Ø×'×'Ð'Ø×#Ñ#Ö%ñ (r   c                ó  €    U O                   U*          v  qEUe   SoUe   SoU O                  QV2       U O                  V2       U O	                  QQ2       PoU]È6¼  cÌ   U[
        O                  [
        O                  [
        O                  17  c˜   U O                  QUQ[        O                   UP
Q5      Q[        O                   UP
Q5      -*          oUO                  Q	Q
2      oU O	                  QU O                  2       U O	                  Q[        [        U2      2      2       U O!                  2        U O"                  Q6w  c(   U%       c   U O$                  O'                  U2       P! P! P!  [         c    QQqT CKph 9 h)a  Send 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???zcode %d, message %sr^   r_   ÚcodeÚmessage©ÚquoteÚexplainzUTF-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_typerg   r[   r�   rc   rš   Úwrite)r   r§   r¨   r«   ÚshortmsgÚlongmsgÚbodyÚcontents   &&&&    r   rq   Ú!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                óÌ   €   U O                  U2       U O                  V2       U O                  QU O                  2       2       U O                  QU O	                  2       2       P! )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©r   r§   r¨   s   &&&r   r±   Ú$BaseHTTPRequestHandler.send_response  sR   � ð 	×Ñ˜ÔØ×Ñ Ô.Ø×Ñ˜ 4×#6Ñ#6Ó#8Ô9Ø×Ñ˜ ×!6Ñ!6Ó!8Ö9r   c                ó>  €   U O                   Q6w  c‹   Ue.   VO                  7   c   U O                  U*          ] *          oLPo[        U Q2      %       f   , U m        U O                  O	                  QU O
                  V1*          O                  QQ2      2       P! P! )zSend the response header only.rL   Ú_headers_bufferz
%s %d %s
úlatin-1Ústrict)re   r¯   r—   rÊ   Úappendrs   r¹   rÇ   s   &&&r   rŽ   Ú)BaseHTTPRequestHandler.send_response_only   sŠ   � à×Ñ :Ô-ØŠØŸ>™>Ô)Ø"Ÿn™n¨TÕ2°1Õ5‘Gà �GÜ˜4Ð!2×3Ò3Ø')�Ô$Ø× Ñ ×'Ñ'¨Ø×*Ñ*¨DÐ:õ*;ß<B¹FØ! 8ó=-ö.ñ .r   Ú	_is_extrac               óâ  €   U O                   Q6w  cŠ   [        U Q2      %       f   , U m        U O                  O                  U8 QU8 Q0O	                  QQ2      2       [        U Q2      %       f   , U m        U%       f   U O
                  O                  V12       UO                  2       Q6X  c?   UO                  2       Q	6X  c
   P	U m        P! UO                  2       Q
6X  c
   P
U m        P! P! P! )z)Send a MIME header to the headers buffer.rL   rÊ   z: rN   rË   rÌ   Ú_default_response_headersÚ
connectionr_   r`   )re   r—   rÊ   rÍ   r¹   rÑ   r�   rf   )r   ÚkeywordÚvaluerÏ   s   &&&$r   r²   Ú"BaseHTTPRequestHandler.send_header.  sÄ   � à×Ñ :Ô-Ü˜4Ð!2×3Ò3Ø')�Ô$Ø× Ñ ×'Ñ'Û!(«%Ð0×8Ñ8¸ÀHÓMôOä˜4Ð!<×=Ò=Ø13�Ô.ßØ×.Ñ.×5Ñ5°wÐ6FÔGà�=‰=‹?˜lÔ*Ø�{‰{‹} Ô'Ø(,�Ö%Ø—‘“ ,Ô.Ø(-�Ö%ñ /ñ +r   c                ó„   €   U O                   Q6w  c.   U O                  O                  Q2       U O                  2        P! P! )z,Send the blank line ending the MIME headers.rL   s   
)re   rÊ   rÍ   Úflush_headersr‘   s   &r   r�   Ú"BaseHTTPRequestHandler.end_headers@  s5   � à×Ñ :Ô-Ø× Ñ ×'Ñ'¨Ô0Ø×ÑÖ ñ .r   c                óØ   €   [        U Q 2      %       c<   U O                  O                  QO                  U O                  2      2       , U m        [        U Q2      %       c
   , U m        P! P! )rÊ   r   rÑ   )r—   rš   r»   ÚjoinrÊ   rÑ   r‘   s   &r   r×   Ú$BaseHTTPRequestHandler.flush_headersF  sT   � Ü�4Ð*×+Ò+Ø�J‰J×Ñ˜SŸX™X d×&:Ñ&:Ó;Ô<Ø#%ˆDÔ Ü�4Ð4×5Ò5Ø-/ˆDÖ*ñ 6r   c           	     ó.  €    [        U2      oUQ 6¼  c   UO                  oLIUQ6¼  c   UO                  oL5UQ6¼  c   UO                  oL!U]È6¼  c   UO                  oLUO
                  o U O                  O                  U O                  2      oUO                  P]2      o[        U2      ]6X  c(   Uv  q‰o
U QUO                   U	 UO                   QU
 0oQU QU U QUO                   U UO                   0	!  [        [        1 c    Po K¨h 9 h)éô  é�  é,  Ú Ú"z" )ro   Ústatus_server_errorÚstatus_client_errorÚstatus_redirectÚ	status_okÚstatus_informationalÚ	TypeErrorrm   rj   Ú	translateÚ_control_char_tablerk   r[   ru   ÚresetÚsize)r   r§   rë   ÚtÚcode_intÚ
code_colorÚrequest_lineÚpartsrŸ   ru   r„   s   &&&&       r   Ú_colorize_requestÚ(BaseHTTPRequestHandler._colorize_requestM  s  � ð	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ÄDc                ó¼   €   [        U[        2      %       c   UO                  oV1U m        U O	                  QU O
                  [        U2      [        U2      2       P! )z>Log an accepted request.

This is called by send_response().

z
"%s" %s %s)Ú
isinstancer   rÔ   Ú_log_request_infoÚlog_messagerj   rg   )r   r§   rë   s   &&&r   rÄ   Ú"BaseHTTPRequestHandler.log_requestf  sJ   � ô �dœJ×'Ò'Ø—:‘:ˆDØ"& ˆÔØ×Ñ˜Ø×)Ñ)¬3¨t«9´c¸$³iö	Ar   c                ó@   €   P	U m         U O                   U,UN3     P! )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   &&*r   r�   Ú BaseHTTPRequestHandler.log_errorr  s   � ð "ˆÔØ×Ò˜Ð' $×'r   z\xÚ02xz\\Ú\c                ó,  €   V*          O                  U O                  2      o[        O                   [        O
                  Q5      O                  o[        U QP2      oUd   PU m        U O                   , UNUM3    oL6[        U QP
2      %       c$   P
U m
        UO                   U UO                   0o[        O
                  O                  UO                   U O                  2        QU O!                  2        QUO                   QU Q0	2       P! )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)r   rú   rû   r¨   rì   Úinfos   &&*   r   rö   Ú"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ðö	
r   c                óL   €   U O                   Q*           U O                  *           ! )z*Return the server software version string.rà   )Úserver_versionÚsys_versionr‘   s   &r   rÅ   Ú%BaseHTTPRequestHandler.version_string©  s   � à×"Ñ" SÕ(¨4×+;Ñ+;Õ;Ð;r   c                óx   €   Ue   [         O                    2       o[        O                  O                  UP	Q5      ! )z@Return the current date and time formatted for a message header.)Úusegmt)ÚtimeÚemailÚutilsÚ
formatdate)r   r	  s   &&r   rÆ   Ú'BaseHTTPRequestHandler.date_time_string­  s-   � àÒÜŸ	š	›ˆIÜ�{‰{×%Ñ% i¸Ð%Ó=Ð=r   c           	     ó¤   €   [         O                    2       o[         O                   U2      v	  q#qEqgq‰o
QV@O                  U*          V%Vg1*          oU! )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   &           r   r  Ú+BaseHTTPRequestHandler.log_date_time_string³  sJ   � ä�iŠi‹kˆÜ04·²¸sÓ0CÑ-ˆ�S˜b a¨AØ*Ø—^‘^ EÕ*¨D°bð.>õ >ˆàˆr   c                ó*   €   U O                   ] *          ! )zReturn the client address.)Úclient_addressr‘   s   &r   r
  Ú%BaseHTTPRequestHandler.address_stringÁ  s   � ð ×"Ñ" 1Õ%Ð%r   úHTTP/1.0)rÑ   rÊ   rù   rõ   rf   rc   rw   ru   rh   re   rj   )NNrR   )Ú-r,  )ÚMonÚTueÚWedÚThuÚFriÚSatÚSun)NÚJanÚFebÚMarÚAprÚMayÚJunÚJulÚAugÚSepÚOctÚNovÚDec)7r   r   r   r   Ú__doc__r  r„   rk   r  r  ÚDEFAULT_ERROR_MESSAGEr¶   ÚDEFAULT_ERROR_CONTENT_TYPErº   rd   r‹   r‚   r¡   r¤   rq   r±   rŽ   r²   r�   r×   rñ   rÄ   r�   rg   Ú	maketransÚ	itertoolsÚchainÚrangeré   Úordrö   rÅ   rÆ   r  Úweekdaynamer  r
  rs   rx   ry   ÚHTTPMessager|   r   Ú__members__ÚvaluesÚphraseÚdescriptionr¯   r!   r"   )ÚcÚvr#   s   00@r   r   r   ­   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                   ó˜   ` `€   \ sQ sQs nQsQsQsQsQQQQQQ	Q
Q-9ss	QPQP-U 1Q kks
Q sQ sQ sQ sQ sQ sQ sQ sQsUsU 9s! )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.

Ú
SimpleHTTPzapplication/octet-streamz.gzzapplication/gzipz.Zz.bz2zapplication/x-bzip2z.xzzapplication/x-xzÚ	directoryÚextra_response_headersc               ó    :€   Ue   [         O                   2       o[         O                   U2      U m        V m        [
        RU _   U- U@    P! rR   )ÚosÚgetcwdÚfspathrS  rT  r3   r4   )r   rS  rT  rû   Úkwargsr7   s   &$$*,€r   r4   Ú!SimpleHTTPRequestHandler.__init__í  s<   ø� ØÒÜŸ	š	›ˆIÜŸš 9Ó-ˆŒØ&<Ô#Ü‰Ò˜$Ð) &Õ)r   c                ó¾   €   U O                  2       oU%       c/    U O                  VO                  2       UO                  2        P! P!  SO                  2        h 9 h)zServe a GET request.)Ú	send_headÚcopyfilerš   r_   ©r   Úfs   & r   Údo_GETÚSimpleHTTPRequestHandler.do_GETô  sA   � à�N‰NÓˆßðØ—‘˜a§¡Ô,à—‘–	ñ	 øð —‘•	ús   ›A
 Á
Ac                ó\   €   U O                  2       oU%       c   UO                  2        P! P! )zServe a HEAD request.)r\  r_   r^  s   & r   Údo_HEADÚ SimpleHTTPRequestHandler.do_HEADý  s   � à�N‰NÓˆßØ�G‰GŽIñ r   c                ó  €   U O                   dq   U O                  TTt. tF   D  v  qUO                  2       jJ  	  oooU O                   F   D/  v  qEUO                  2       U7  f   J  U O                  VEP	Q5       J1  	  P! P! t tooh )z7Send the headers stored in self.extra_response_headers.)rÏ   )rT  rÑ   r�   r²   )r   ÚhÚ_Údefault_headersÚheaderrÔ   s   &     r   Ú_send_extra_response_headersÚ5SimpleHTTPRequestHandler._send_extra_response_headers  so   � à×&Ñ&Ò2Ø59×5SÑ5SÔTÓ5S©T¨Q˜qŸw™wžyÑ5SˆOÑTØ!%×!<Õ!<‘�ð —<‘<“>¨Ö8Ø×$Ñ$ V¸dÐ$ÖCó	 "=ñ 3ùÛTs   žBc                óî  €   U O                  U O                  2      oPo[        O                  O                  U2      %       Cc^   [        O
                  O                  U O                  2      oUO                  O                  Q2      %       f¦   U O                  [        O                  2       U] *          U]*          U]*          Q*           U]*          U]*          1o[        O
                  O                  U2      oU O                  QU2       U O                  QQ2       U O                  2        P! U O                  F   DL  o[        O                  O                  V2      o[        O                  O!                  U2      %       f   JI  So  L	  U O#                  U2      ! U O%                  U2      oUO                  Q2      %       c#   U O'                  [        O(                  Q2       P!  [+        UQ2      o [        O.                   UO1                  2       2      oQU O2                  7   Cc?   QU O2                  7  Cc-    [4        O6                  O9                  U O2                  Q*          2      o	U	O:                  e+   U	O=                  [>        O@                  OB                  Q	5      o	U	O:                  [>        O@                  OB                  I cœ   [>        O>                  OE                  UOF                  [>        O@                  OB                  2      o
U
O=                  ] Q
5      o
V©6:  cB   U O                  [        OH                  2       U O                  2        UOK                  2        P! U O                  [        OT                  2       U O                  QU2       U O                  Q[W        U]*          2      2       U O                  QU OY                  UOF                  2      2       U O[                  2        U O                  2        U!  [,         c%    S O'                  [        O(                  Q2        P! h 9 h [L        [N        [P        [R        1 c     Kïh 9 h  SOK                  2        g 9 h)aK  Common 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.

rO   ÚLocationr­   Ú0zFile not foundÚrbzIf-Modified-SincezIf-None-Match)Útzinfo)ÚmicrosecondúContent-typezLast-Modified)rO   z%2fz%2F).Útranslate_pathru   rV  ÚisdirÚurllibÚparseÚurlsplitÚendswithr±   r   ÚMOVED_PERMANENTLYÚ
urlunsplitr²   r�   Úindex_pagesrÚ   ÚisfileÚlist_directoryÚ
guess_typerq   Ú	NOT_FOUNDÚopenÚOSErrorÚfstatÚfilenorw   r  r  Úparsedate_to_datetimerp  r¬   ÚdatetimeÚtimezoneÚutcÚfromtimestampÚst_mtimerµ   r_   rç   rp   ÚOverflowErrorrm   ÚOKrg   rÆ   rj  )r   ru   r_  rð   Ú	new_partsÚnew_urlÚindexÚctypeÚfsÚimsÚ
last_modifs   &          r   r\  Ú"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! È0Q! É0Q  É3Q! ÊAQ! ËAQ! Ì-?Q! Í.BQ! Ð	P=Ð!P=Ð<P=Ñ QÑQÑQ! ÑQÑQ! Ñ!Q4c                óü  €    [         O                   U2      oUO                  Q Q5       , oU O                  oUO                  Q]2      ] *          oUO                  Q]2      ] *          o [        O                  O                  UQQ5      o[        O                   UP
Q5      o[        O                    2       oQ	U 0oUO#                  Q
2       UO#                  Q2       UO#                  Q2       UO#                  QU Q02       UO#                  Q2       UO#                  QU Q02       UO#                  QU Q02       UO#                  Q2       SF   DÙ  o[         O                  O%                  V2      oS9qš[         O                  O'                  U2      %       c   UQ*           o	UQ*           o
[         O                  O)                  U2      %       c
   UQ*           o	UO#                  Q[        O                  O+                  U
QQ5      8 Q[        O                   U	P
Q5      8 Q02       JÛ  	  UO#                  Q2       QO%                  U2      O-                  UQ2      o[.        O0                   2       oUO3                  U2       UO5                  ] 2       U O7                  [        O8                  2       U O;                  QQU*          2       U O;                  Q[=        [?        U2      2      2       U OA                  2        U OC                  2        U!  [         c%    S O                  [        O
                  Q2        P! h 9 h [         c$    [        O                  O                  S2      o CKìh 9 h)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().

zNo permission to list directoryc                 ó$   €   U O                  2       ! rR   )r�   )Úas   &r   Ú<lambda>Ú9SimpleHTTPRequestHandler.list_directory.<locals>.<lambda>u  s
   �  §¡¤	r   )ÚkeyÚ#Ú?Úsurrogatepass©Úerrorsr©   zDirectory 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>rO   Ú@z<li><a href="z	</a></li>z</ul>
<hr>
</body>
</html>
r  Úsurrogateescaperr  ztext/html; charset=%sr­   )"rV  Úlistdirr�  rq   r   r  Úsortru   rk   ru  rv  ÚunquoteÚUnicodeDecodeErrorr·   r¸   r  ÚgetfilesystemencodingrÍ   rÚ   rt  Úislinkrª   r¹   ÚioÚBytesIOr»   Úseekr±   r‹  r²   rg   r[   rj  r�   )r   ru   ÚlistÚrÚdisplaypathÚencÚtitleÚnameÚfullnameÚdisplaynameÚlinknameÚencodedr_  s   &&           r   r}  Ú'SimpleHTTPRequestHandler.list_directoryf  sÐ  � ð	Ü—:’:˜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                ó¾  €   UO                  Q]2      ] *          oUO                  Q]2      ] *          o [        O                  O                  UQQ5      oUO                  Q2      o[        O                   U2      oUO                  Q2      o[        PU2      oU O                  oSF   Dn  o[        O                  O                  U2      %       f&   U[        O                  [        O                  17   c   JO  [        O                  O                  V2      oJp  	  U%       c
   UQ*          oU!  [         c$    [        O                  O                  S2      o CKh 9 h)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�  rO   )rk   ru  rv  r£  r¤  rx  Ú	posixpathÚnormpathÚfilterrS  rV  ru   ÚdirnameÚcurdirÚpardirrÚ   )r   ru   Útrailing_slashr…   Úwords   &&   r   rs  Ú'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ÅEc                ó4   €   [         O                   V2       P! )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   &&&r   r]  Ú!SimpleHTTPRequestHandler.copyfileÂ  s   � ô 	×Ò˜6Ö.r   c                ó<  €   [         O                   U2      v  q#V0O                  7   c   U O                  U*          ! UO                  2       oV0O                  7   c   U O                  U*          ! [        O
                   U2      v  qEU%       c   U! U O                  ! )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)r   ru   ÚbaseÚextÚguessrg  s   &&    r   r~  Ú#SimpleHTTPRequestHandler.guess_typeÒ  s�   � ô ×&Ò& tÓ,‰	ˆØ×%Ñ%Ô%Ø×&Ñ& sÕ+Ð+Ø�i‰i‹kˆØ×%Ñ%Ô%Ø×&Ñ& sÕ+Ð+Ü×,Ò,¨TÓ2‰ˆßØˆLØ×(Ñ(Ð(r   ©rS  rT  )z
index.htmlz	index.htm)r   r   r   r   r@  r  rÊ  r{  rÇ  Ú_encodings_map_defaultr4   r`  rc  rj  r\  r}  rs  r]  r~  r!   r"   rG   rH   s   @@r   r   r   Ö  s‡   ù‡ � ñ	ð "€NØ5ÐØ-€KàÐ!ØÐ(ØÐ%ØÐ!ð	/ð €NÐ+ð*¨ð *ÀT÷ *òòòDòWòr<ò|ò</÷ )ò )r   c                 ó  €   [         %       c   [         !  ] PHo  U O                  Q2      ]*          r [         !  [         c    Pt ! h 9 h [         c/    ][        Q S O                  2       2       2      *           r  [         ! h 9 h)z$Internal routine to get nobody's uidÚnobodyc              3   ó>   €  S F      €   D  p]*          w €	   J  	  P! 3h)r   r%   )rU   r#  s   & r   rW   Únobody_uid.<locals>.<genexpr>ú  s   ù¢~é � ¡~ !˜1Ÿ›£~ùs   ‡)rÒ  Úpwdr0   Ú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ÂBc                óN   €   [         O                   U [         O                  2      ! )zTest for executable file.)rV  ÚaccessÚX_OK)ru   s   &r   Ú
executablerÝ  þ  s   � ä�9Š9�Tœ2Ÿ7™7Ó#Ð#r   c                  ó¤   €   [         O                   U Q [         O                  Q[         O                  -   o[	        [        U2      2      v  q#qEoV&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ØÐÐr   r+  é@  c	                 óx   €   [        VC2      v  Um        o	V m        V€m        U%       c   U V�UVgQ 5      ! U V�2      ! ))r2   r*   r+   )rì  Úaddress_familyrs   rÊ  )
ÚHandlerClassÚServerClassÚprotocolr   ÚbindÚtls_certÚtls_keyÚtls_passwordrÊ  Úaddrs
   &&&&&&&&& r   Ú_make_serverrø    sH   � ô
 (8¸Ó'CÑ$€KÔ Ø$,Ô!Ø(<Ô%çÙ˜4¸Ø#*ôCð 	Cñ ˜4Ó.Ð.r   c	                óv  €   [        VV#UVgUUQ5	      9^tt^ 2       o	U	O                  O                  2       Q*          v  q£QU
7   c   QU
 Q0LS
oU%       c   QLQo[        O                   2       O
                  oUO                  2        QU QU Q	0o[        UO                   Q
U QU
 QU UO                   QUO                   U UO                   Q02        U	O                  2        PPP2       P!  [         c%    [        Q2       [        O                   ] 2        K8h 9 h ) %       f   h     P! 9 h)zdTest the HTTP request handler class.

This runs an HTTP server on port 8000 (or the port argument).
)	rð  rñ  rò  r   ró  rô  rõ  rö  rÊ  r   Ú:Ú[r  ÚHTTPSÚHTTPz://rO   zServing z on z port z (z) ...z&
Keyboard interrupt received, exiting.)rø  r   Úgetsocknamer  r  r  r�   ÚprintÚservingrê   ÚurlÚserve_foreverÚKeyboardInterruptr  Úexit)rð  rñ  rò  r   ró  Úcontent_typerô  rõ  rö  Úhttpdr   Úurl_hostrì   r  s   &&&&&&&&&     r   Útestr    s.  � ô 
Ø!Ø¨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'ÁBD'ÃC5Ã5	D$Ã?"D$Ä!D'Ä#D$Ä$D'Ä'D8	Ä0D8	c                 ó8  ` `
€   ] PHo] PHn
UO                  2       oUO                  QQQQQ5       UO                  QQ[        O
                   2       QQ	5       UO                  Q
QQQQQ5       UO                  Q[        O                  QQ	5       UO                  QQQQ5       UO                  QQQQ5       UO                  QQQQ5       UO                  QQ[        QQQ5       UO                  QQ]Q Q0Q!Q"5       UO                  R 2      n R O                  %       f$   R O                  %       c   UO                  Q#2       PoR O                  %       cl   R O                  %       f   UO                  Q$2        [        R O                  Q%Q&Q'5      9^tt^ 2       oUO                  2       O!                  2       oPPP2         U U
1Q) kQ*2      o  Q+ Q,U[$        2      o  Q- Q.U[&        2      oR O                  %       c   SLSo	[)        [        U	R O*                  R O,                  R O.                  R O0                  R O                  R O                  UQ/5	       P!  ) %       f   h     Kª9 h ["         c   oSO                  Q(S 02        Po=KÑPo=hh 9 h)1r.   z-bz--bindÚADDRESSz.bind to this address (default: all interfaces))ÚmetavarÚhelpz-dz--directoryz1serve this directory (default: current directory))Údefaultr  z-pz
--protocolÚVERSIONr+  z3conform to this HTTP version (default: %(default)s))r  r  r  z--content-typezBdefault content type for unknown extensions (default: %(default)s)z
--tls-certÚPATHz&path to the TLS certificate chain filez	--tls-keyzpath to the TLS key filez--tls-password-filez)path to the password file for the TLS keyr   rí  r›  z(bind to this port (default: %(default)s))r  rß  Únargsr  z-Hz--headerrÍ   z>Add a custom response header (can be specified multiple times))r  Úactionr  r  z'--tls-key requires --tls-cert to be setz1--tls-password-file requires --tls-cert to be setr«  zutf-8)Úencodingz"Failed to read TLS password file: c                   óD   :` `€   \ sQ sQs nU U1Q ksU1Q ksQsUsU 9s! )Ú#_main.<locals>.DualStackServerMixinim  c                ó  :€   RO                  [        2      9^tt^ 2        U O                  O                  [        O                  [        O
                  ] 2       PPP2       [        RU _  2       !  ) %       f   h     K9 h)r.   )ÚsuppressÚ	Exceptionr   Ú
setsockoptÚIPPROTO_IPV6ÚIPV6_V6ONLYr3   r   )r   r7   Ú
contextlibs   &€€r   r   Ú/_main.<locals>.DualStackServerMixin.server_bindo  sX   ø� à×$Ñ$¤Y×/Õ/Ø—‘×&Ñ&Ü×'Ñ'¬×);Ñ);¸Qô@÷ 0ô ‘7Ñ&Ó(Ð(÷ 0×/ús    :A0Á0B 	Á9B 	c                ó\   :€   U O                  VU RO                  RO                  Q 5       P! )rÏ  )r5   rS  ri  )r   Úrequestr)  rû   s   &&&€r   Úfinish_requestÚ2_main.<locals>.DualStackServerMixin.finish_requestv  s)   ø� Ø×$Ñ$ W¸dØ/3¯~©~Ø<@¿K¹Kð %ö Ir   r%   )	r   r   r   r   r   r  r!   r"   rG   )r7   r#   rû   r  s   @@€€r   ÚDualStackServerMixinr  m  s   ú‡ � ö	)÷	Iõ 	Ir   r!  c                   ó   €   \ sQ sQsQsP! )Ú"_main.<locals>.HTTPDualStackServeri{  r%   ©r   r   r   r   r!   r%   r   r   ÚHTTPDualStackServerr#  {  ó   ‡ Ûr   r%  c                   ó   €   \ sQ sQsQsP! )Ú#_main.<locals>.HTTPSDualStackServeri}  r%   r$  r%   r   r   ÚHTTPSDualStackServerr(  }  r&  r   r)  )	rð  rñ  r   ró  rò  r  rô  rõ  rö  )ÚHEADERÚVALUE)Úargparser  ÚArgumentParserÚadd_argumentrV  rW  r   rÊ  ro   Ú
parse_argsrô  rõ  r  Útls_password_filer€  ÚreadÚstripr�  r   r   r  r   ró  rò  r  )rû   r,  ÚparserÚtls_key_passwordr_  r    r!  r%  r)  rñ  r  s   f         @r   Ú_mainr5  <  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Ø—‘Ø×&Ñ&Ø—‘Ø—‘Ø%÷
÷7 E×Dûäô 	CØ�L‰LÐ=¸a¸SÐA×BÑBûð	CúsB   Å< I0 ÆIÆ;I0 ÉI-	É&I-	É(I0 É-I0 É0	JÉ:JÉ;JÊJc                 ód   €   U Q 6X  c   ] QHGo U Q QQ5       Q! [        Q[        8 QU 8 02      g)Ú__version__)Ú_deprecated)Úremovez0.6zmodule z has no attribute )é   é   )Úwarningsr8  ÚAttributeErrorr   )r¯  r8  s   & r   Ú__getattr__r>  �  s3   � Øˆ}ÔÝ(á�M¨'Õ2ÙÜ
˜7¤8¡,Ð.@ÀÁÐIÓ
JÐJr   Ú__main__)r   r   r   r   r   r   rR   )+r@  Ú__all__r…  Úemail.utilsr  r·   Úhttp.clientrx   r§  rD  rÈ  rV  r¶  rÀ  r   r   r  r  Úurllib.parseru  r   r  rA  rB  r   r   ÚThreadingMixInr   r   r   ÚStreamRequestHandlerr   r   rÒ  rÙ  rÝ  rì  rÊ  rø  r  r5  r>  r   r%   r   r   Ú<module>rF     sB  ññò~€ó Û Û Û Û 	Û Û Û 	Û Û Û Û Û 
Û Û å ã ðÐ ð* 7Ð ô
 �×'Ñ'ô 
 ô˜,×5Ñ5°zô ô"�*ô "ôJ˜<×6Ñ6¸ô ôf˜\×>Ñ>ô fôRS)Ð5ô S)ðl 
€òò $ò
ð 5Ø0Ø$¨4°dØ¨¸4Ø&>×&SÑ&Sô	/ð  /Ø(Ø 4¨dØ.×CÑCØ °4ô	ô>PòfKð ˆzÔÙ	†Gñ r   